OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void LayerImpl::DidDraw(ResourceProvider* resource_provider) { | 185 void LayerImpl::DidDraw(ResourceProvider* resource_provider) { |
186 DCHECK_NE(DRAW_MODE_NONE, current_draw_mode_); | 186 DCHECK_NE(DRAW_MODE_NONE, current_draw_mode_); |
187 current_draw_mode_ = DRAW_MODE_NONE; | 187 current_draw_mode_ = DRAW_MODE_NONE; |
188 } | 188 } |
189 | 189 |
190 bool LayerImpl::ShowDebugBorders() const { | 190 bool LayerImpl::ShowDebugBorders() const { |
191 return layer_tree_impl()->debug_state().show_debug_borders; | 191 return layer_tree_impl()->debug_state().show_debug_borders; |
192 } | 192 } |
193 | 193 |
194 void LayerImpl::GetDebugBorderProperties(SkColor* color, float* width) const { | 194 void LayerImpl::GetDebugBorderProperties(SkColor* color, float* width) const { |
| 195 float device_scale_factor = |
| 196 layer_tree_impl() ? layer_tree_impl()->device_scale_factor() : 1; |
| 197 |
195 if (draws_content_) { | 198 if (draws_content_) { |
196 *color = DebugColors::ContentLayerBorderColor(); | 199 *color = DebugColors::ContentLayerBorderColor(); |
197 *width = DebugColors::ContentLayerBorderWidth(layer_tree_impl()); | 200 *width = DebugColors::ContentLayerBorderWidth(device_scale_factor); |
198 return; | 201 return; |
199 } | 202 } |
200 | 203 |
201 if (masks_to_bounds_) { | 204 if (masks_to_bounds_) { |
202 *color = DebugColors::MaskingLayerBorderColor(); | 205 *color = DebugColors::MaskingLayerBorderColor(); |
203 *width = DebugColors::MaskingLayerBorderWidth(layer_tree_impl()); | 206 *width = DebugColors::MaskingLayerBorderWidth(device_scale_factor); |
204 return; | 207 return; |
205 } | 208 } |
206 | 209 |
207 *color = DebugColors::ContainerLayerBorderColor(); | 210 *color = DebugColors::ContainerLayerBorderColor(); |
208 *width = DebugColors::ContainerLayerBorderWidth(layer_tree_impl()); | 211 *width = DebugColors::ContainerLayerBorderWidth(device_scale_factor); |
209 } | 212 } |
210 | 213 |
211 void LayerImpl::AppendDebugBorderQuad( | 214 void LayerImpl::AppendDebugBorderQuad( |
212 RenderPass* render_pass, | 215 RenderPass* render_pass, |
213 const gfx::Size& bounds, | 216 const gfx::Size& bounds, |
214 const SharedQuadState* shared_quad_state, | 217 const SharedQuadState* shared_quad_state, |
215 AppendQuadsData* append_quads_data) const { | 218 AppendQuadsData* append_quads_data) const { |
216 SkColor color; | 219 SkColor color; |
217 float width; | 220 float width; |
218 GetDebugBorderProperties(&color, &width); | 221 GetDebugBorderProperties(&color, &width); |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 | 1064 |
1062 ScrollTree& LayerImpl::GetScrollTree() const { | 1065 ScrollTree& LayerImpl::GetScrollTree() const { |
1063 return GetPropertyTrees()->scroll_tree; | 1066 return GetPropertyTrees()->scroll_tree; |
1064 } | 1067 } |
1065 | 1068 |
1066 TransformTree& LayerImpl::GetTransformTree() const { | 1069 TransformTree& LayerImpl::GetTransformTree() const { |
1067 return GetPropertyTrees()->transform_tree; | 1070 return GetPropertyTrees()->transform_tree; |
1068 } | 1071 } |
1069 | 1072 |
1070 } // namespace cc | 1073 } // namespace cc |
OLD | NEW |