Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: cc/debug/debug_rect_history.cc

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Fix nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/input/event_listener_properties.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 } 175 }
176 176
177 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) { 177 void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) {
178 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { 178 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
179 SaveWheelEventHandlerRectsCallback(layer); 179 SaveWheelEventHandlerRectsCallback(layer);
180 }); 180 });
181 } 181 }
182 182
183 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) { 183 void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) {
184 if (!layer->layer_tree_impl()->have_wheel_event_handlers()) 184 EventListenerProperties event_properties =
185 layer->layer_tree_impl()->event_listener_properties(
186 EventListenerClass::kMouseWheel);
187 if (event_properties == EventListenerProperties::kNone ||
188 (layer->layer_tree_impl()->settings().use_mouse_wheel_gestures &&
189 event_properties == EventListenerProperties::kPassive)) {
185 return; 190 return;
191 }
186 192
187 debug_rects_.push_back( 193 debug_rects_.push_back(
188 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE, 194 DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE,
189 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(), 195 MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(),
190 gfx::Rect(layer->bounds())))); 196 gfx::Rect(layer->bounds()))));
191 } 197 }
192 198
193 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { 199 void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) {
194 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { 200 LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
195 SaveScrollEventHandlerRectsCallback(layer); 201 SaveScrollEventHandlerRectsCallback(layer);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 debug_rects_.push_back( 246 debug_rects_.push_back(
241 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, 247 DebugRect(ANIMATION_BOUNDS_RECT_TYPE,
242 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), 248 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(),
243 inflated_bounds.y(), 249 inflated_bounds.y(),
244 inflated_bounds.width(), 250 inflated_bounds.width(),
245 inflated_bounds.height())))); 251 inflated_bounds.height()))));
246 } 252 }
247 } 253 }
248 254
249 } // namespace cc 255 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/input/event_listener_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698