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" |
11 #include "cc/layers/layer_iterator.h" | 11 #include "cc/layers/layer_iterator.h" |
12 #include "cc/layers/layer_utils.h" | 12 #include "cc/layers/layer_utils.h" |
13 #include "cc/layers/render_surface_impl.h" | 13 #include "cc/layers/render_surface_impl.h" |
14 #include "cc/trees/damage_tracker.h" | 14 #include "cc/trees/damage_tracker.h" |
15 #include "cc/trees/layer_tree_host.h" | 15 #include "cc/trees/layer_tree_host.h" |
16 #include "cc/trees/layer_tree_host_common.h" | 16 #include "cc/trees/layer_tree_host_common.h" |
| 17 #include "cc/trees/layer_tree_impl.h" |
17 #include "ui/gfx/geometry/rect_conversions.h" | 18 #include "ui/gfx/geometry/rect_conversions.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 // static | 22 // static |
22 scoped_ptr<DebugRectHistory> DebugRectHistory::Create() { | 23 scoped_ptr<DebugRectHistory> DebugRectHistory::Create() { |
23 return make_scoped_ptr(new DebugRectHistory()); | 24 return make_scoped_ptr(new DebugRectHistory()); |
24 } | 25 } |
25 | 26 |
26 DebugRectHistory::DebugRectHistory() {} | 27 DebugRectHistory::DebugRectHistory() {} |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 174 } |
174 } | 175 } |
175 | 176 |
176 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) { | 177 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) { |
177 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { | 178 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { |
178 SaveWheelEventHandlerRectsCallback(layer); | 179 SaveWheelEventHandlerRectsCallback(layer); |
179 }); | 180 }); |
180 } | 181 } |
181 | 182 |
182 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) { | 183 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) { |
183 if (!layer->have_wheel_event_handlers()) | 184 if (!layer->layer_tree_impl()->have_wheel_event_handlers()) |
184 return; | 185 return; |
185 | 186 |
186 debug_rects_.push_back( | 187 debug_rects_.push_back( |
187 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE, | 188 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE, |
188 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(), | 189 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(), |
189 gfx::Rect(layer->bounds())))); | 190 gfx::Rect(layer->bounds())))); |
190 } | 191 } |
191 | 192 |
192 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { | 193 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { |
193 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { | 194 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 debug_rects_.push_back( | 240 debug_rects_.push_back( |
240 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, | 241 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, |
241 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), | 242 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), |
242 inflated_bounds.y(), | 243 inflated_bounds.y(), |
243 inflated_bounds.width(), | 244 inflated_bounds.width(), |
244 inflated_bounds.height())))); | 245 inflated_bounds.height())))); |
245 } | 246 } |
246 } | 247 } |
247 | 248 |
248 } // namespace cc | 249 } // namespace cc |
OLD | NEW |