| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (debug_state.show_layer_animation_bounds_rects) | 65 if (debug_state.show_layer_animation_bounds_rects) |
| 66 SaveLayerAnimationBoundsRects(render_surface_layer_list); | 66 SaveLayerAnimationBoundsRects(render_surface_layer_list); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void DebugRectHistory::SavePaintRects(LayerImpl* root_layer) { | 69 void DebugRectHistory::SavePaintRects(LayerImpl* root_layer) { |
| 70 // We would like to visualize where any layer's paint rect (update rect) has | 70 // We would like to visualize where any layer's paint rect (update rect) has |
| 71 // changed, regardless of whether this layer is skipped for actual drawing or | 71 // changed, regardless of whether this layer is skipped for actual drawing or |
| 72 // not. Therefore we traverse over all layers, not just the render surface | 72 // not. Therefore we traverse over all layers, not just the render surface |
| 73 // list. | 73 // list. |
| 74 for (auto* layer : *root_layer->layer_tree_impl()) { | 74 for (auto* layer : *root_layer->layer_tree_impl()) { |
| 75 Region invalidation_region = layer->GetInvalidationRegion(); | 75 Region invalidation_region = layer->GetInvalidationRegionForDebugging(); |
| 76 if (invalidation_region.IsEmpty() || !layer->DrawsContent()) | 76 if (invalidation_region.IsEmpty() || !layer->DrawsContent()) |
| 77 continue; | 77 continue; |
| 78 | 78 |
| 79 for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) { | 79 for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) { |
| 80 debug_rects_.push_back(DebugRect( | 80 debug_rects_.push_back(DebugRect( |
| 81 PAINT_RECT_TYPE, MathUtil::MapEnclosingClippedRect( | 81 PAINT_RECT_TYPE, MathUtil::MapEnclosingClippedRect( |
| 82 layer->ScreenSpaceTransform(), it.rect()))); | 82 layer->ScreenSpaceTransform(), it.rect()))); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 } | 85 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 debug_rects_.push_back( | 246 debug_rects_.push_back( |
| 247 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, | 247 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, |
| 248 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), | 248 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), |
| 249 inflated_bounds.y(), | 249 inflated_bounds.y(), |
| 250 inflated_bounds.width(), | 250 inflated_bounds.width(), |
| 251 inflated_bounds.height())))); | 251 inflated_bounds.height())))); |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace cc | 255 } // namespace cc |
| OLD | NEW |