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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) { | 176 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) { |
177 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { | 177 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { |
178 SaveWheelEventHandlerRectsCallback(layer); | 178 SaveWheelEventHandlerRectsCallback(layer); |
179 }); | 179 }); |
180 } | 180 } |
181 | 181 |
182 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) { | 182 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) { |
183 if (!layer->have_wheel_event_handlers()) | 183 if (layer->wheel_event_properties() == EventListenerProperties::NONE) |
184 return; | 184 return; |
185 | 185 |
186 debug_rects_.push_back( | 186 debug_rects_.push_back( |
187 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE, | 187 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE, |
188 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(), | 188 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(), |
189 gfx::Rect(layer->bounds())))); | 189 gfx::Rect(layer->bounds())))); |
190 } | 190 } |
191 | 191 |
192 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { | 192 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { |
193 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { | 193 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { |
(...skipping 45 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 |