| 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 "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
| 8 #include "cc/layers/layer_impl.h" | 8 #include "cc/layers/layer_impl.h" |
| 9 #include "cc/layers/layer_iterator.h" | 9 #include "cc/layers/layer_iterator.h" |
| 10 #include "cc/layers/layer_utils.h" | 10 #include "cc/layers/layer_utils.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // not. Therefore we traverse recursively over all layers, not just the render | 76 // not. Therefore we traverse recursively over all layers, not just the render |
| 77 // surface list. | 77 // surface list. |
| 78 | 78 |
| 79 if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) { | 79 if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) { |
| 80 float width_scale = layer->content_bounds().width() / | 80 float width_scale = layer->content_bounds().width() / |
| 81 static_cast<float>(layer->bounds().width()); | 81 static_cast<float>(layer->bounds().width()); |
| 82 float height_scale = layer->content_bounds().height() / | 82 float height_scale = layer->content_bounds().height() / |
| 83 static_cast<float>(layer->bounds().height()); | 83 static_cast<float>(layer->bounds().height()); |
| 84 gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect( | 84 gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect( |
| 85 gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale); | 85 gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale); |
| 86 debug_rects_.push_back( | 86 debug_rects_.push_back(DebugRect( |
| 87 DebugRect(PAINT_RECT_TYPE, | 87 layer->includes_first_paint_invalidation() ? FIRST_PAINT_RECT_TYPE |
| 88 MathUtil::MapEnclosingClippedRect( | 88 : PAINT_RECT_TYPE, |
| 89 layer->screen_space_transform(), update_content_rect))); | 89 MathUtil::MapEnclosingClippedRect(layer->screen_space_transform(), |
| 90 update_content_rect))); |
| 90 } | 91 } |
| 91 | 92 |
| 92 for (unsigned i = 0; i < layer->children().size(); ++i) | 93 for (unsigned i = 0; i < layer->children().size(); ++i) |
| 93 SavePaintRects(layer->children()[i]); | 94 SavePaintRects(layer->children()[i]); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void DebugRectHistory::SavePropertyChangedRects( | 97 void DebugRectHistory::SavePropertyChangedRects( |
| 97 const LayerImplList& render_surface_layer_list, | 98 const LayerImplList& render_surface_layer_list, |
| 98 LayerImpl* hud_layer) { | 99 LayerImpl* hud_layer) { |
| 99 for (int surface_index = render_surface_layer_list.size() - 1; | 100 for (int surface_index = render_surface_layer_list.size() - 1; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 debug_rects_.push_back( | 286 debug_rects_.push_back( |
| 286 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, | 287 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, |
| 287 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), | 288 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), |
| 288 inflated_bounds.y(), | 289 inflated_bounds.y(), |
| 289 inflated_bounds.width(), | 290 inflated_bounds.width(), |
| 290 inflated_bounds.height())))); | 291 inflated_bounds.height())))); |
| 291 } | 292 } |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace cc | 295 } // namespace cc |
| OLD | NEW |