| 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_utils.h" | 9 #include "cc/layers/layer_utils.h" |
| 10 #include "cc/layers/render_surface_impl.h" | 10 #include "cc/layers/render_surface_impl.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 layer->contents_scale_y()); | 231 layer->contents_scale_y()); |
| 232 debug_rects_.push_back(DebugRect(NON_FAST_SCROLLABLE_RECT_TYPE, | 232 debug_rects_.push_back(DebugRect(NON_FAST_SCROLLABLE_RECT_TYPE, |
| 233 MathUtil::MapClippedRect( | 233 MathUtil::MapClippedRect( |
| 234 layer->screen_space_transform(), | 234 layer->screen_space_transform(), |
| 235 scroll_rect))); | 235 scroll_rect))); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 void DebugRectHistory::SaveLayerAnimationBoundsRects( | 239 void DebugRectHistory::SaveLayerAnimationBoundsRects( |
| 240 const LayerImplList& render_surface_layer_list) { | 240 const LayerImplList& render_surface_layer_list) { |
| 241 typedef LayerIterator<LayerImpl> LayerIteratorType; | 241 typedef LayerIterator<LayerImpl, |
| 242 LayerImplList, |
| 243 RenderSurfaceImpl, |
| 244 LayerIteratorActions::FrontToBack> LayerIteratorType; |
| 242 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); | 245 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); |
| 243 for (LayerIteratorType it = | 246 for (LayerIteratorType it = |
| 244 LayerIteratorType::Begin(&render_surface_layer_list); | 247 LayerIteratorType::Begin(&render_surface_layer_list); |
| 245 it != end; ++it) { | 248 it != end; ++it) { |
| 246 if (!it.represents_itself()) | 249 if (!it.represents_itself()) |
| 247 continue; | 250 continue; |
| 248 | 251 |
| 249 // TODO(avallee): Figure out if we should show something for a layer who's | 252 // TODO(avallee): Figure out if we should show something for a layer who's |
| 250 // animating bounds but that we can't compute them. | 253 // animating bounds but that we can't compute them. |
| 251 gfx::BoxF inflated_bounds; | 254 gfx::BoxF inflated_bounds; |
| 252 if (!LayerUtils::GetAnimationBounds(**it, &inflated_bounds)) | 255 if (!LayerUtils::GetAnimationBounds(**it, &inflated_bounds)) |
| 253 continue; | 256 continue; |
| 254 | 257 |
| 255 debug_rects_.push_back(DebugRect(ANIMATION_BOUNDS_RECT_TYPE, | 258 debug_rects_.push_back(DebugRect(ANIMATION_BOUNDS_RECT_TYPE, |
| 256 gfx::RectF(inflated_bounds.x(), | 259 gfx::RectF(inflated_bounds.x(), |
| 257 inflated_bounds.y(), | 260 inflated_bounds.y(), |
| 258 inflated_bounds.width(), | 261 inflated_bounds.width(), |
| 259 inflated_bounds.height()))); | 262 inflated_bounds.height()))); |
| 260 } | 263 } |
| 261 } | 264 } |
| 262 | 265 |
| 263 } // namespace cc | 266 } // namespace cc |
| OLD | NEW |