| 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/debug/debug_rect_history.h" | 5 #include "cc/debug/debug_rect_history.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 if (debug_state.show_screen_space_rects) | 60 if (debug_state.show_screen_space_rects) |
| 61 SaveScreenSpaceRects(render_surface_layer_list); | 61 SaveScreenSpaceRects(render_surface_layer_list); |
| 62 | 62 |
| 63 if (debug_state.show_layer_animation_bounds_rects) | 63 if (debug_state.show_layer_animation_bounds_rects) |
| 64 SaveLayerAnimationBoundsRects(render_surface_layer_list); | 64 SaveLayerAnimationBoundsRects(render_surface_layer_list); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void DebugRectHistory::SavePaintRects(LayerImpl* layer) { | 67 void DebugRectHistory::SavePaintRects(LayerImpl* layer) { |
| 68 // We would like to visualize where any layer's paint rect (update rect) has | 68 // We would like to visualize where any layer's paint rect (update rect) has |
| 69 // changed, regardless of whether this layer is skipped for actual drawing or | 69 // changed, regardless of whether this layer is skipped for actual drawing or |
| 70 // not. Therefore we traverse recursively over all layers, not just the render | 70 // not. Therefore we traverse over all layers, not just the render surface |
| 71 // surface list. | 71 // list. |
| 72 | 72 |
| 73 Region invalidation_region = layer->GetInvalidationRegion(); | 73 Region invalidation_region = layer->GetInvalidationRegion(); |
| 74 if (!invalidation_region.IsEmpty() && layer->DrawsContent()) { | 74 if (!invalidation_region.IsEmpty() && layer->DrawsContent()) { |
| 75 for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) { | 75 for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) { |
| 76 debug_rects_.push_back(DebugRect( | 76 debug_rects_.push_back(DebugRect( |
| 77 PAINT_RECT_TYPE, MathUtil::MapEnclosingClippedRect( | 77 PAINT_RECT_TYPE, MathUtil::MapEnclosingClippedRect( |
| 78 layer->ScreenSpaceTransform(), it.rect()))); | 78 layer->ScreenSpaceTransform(), it.rect()))); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 debug_rects_.push_back( | 239 debug_rects_.push_back( |
| 240 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, | 240 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, |
| 241 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), | 241 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), |
| 242 inflated_bounds.y(), | 242 inflated_bounds.y(), |
| 243 inflated_bounds.width(), | 243 inflated_bounds.width(), |
| 244 inflated_bounds.height())))); | 244 inflated_bounds.height())))); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace cc | 248 } // namespace cc |
| OLD | NEW |