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

Side by Side Diff: cc/layers/layer_impl.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 | « cc/input/input_handler.h ('k') | cc/proto/layer_tree_host.proto » ('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/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 gfx::ToRoundedPoint(hit_test_point_in_layer_space))) { 547 gfx::ToRoundedPoint(hit_test_point_in_layer_space))) {
548 TRACE_EVENT0("cc", 548 TRACE_EVENT0("cc",
549 "LayerImpl::tryScroll: Failed NonFastScrollableRegion"); 549 "LayerImpl::tryScroll: Failed NonFastScrollableRegion");
550 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; 550 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD;
551 scroll_status.main_thread_scrolling_reasons = 551 scroll_status.main_thread_scrolling_reasons =
552 MainThreadScrollingReason::kNonFastScrollableRegion; 552 MainThreadScrollingReason::kNonFastScrollableRegion;
553 return scroll_status; 553 return scroll_status;
554 } 554 }
555 } 555 }
556 556
557 if ((type == InputHandler::WHEEL || type == InputHandler::ANIMATED_WHEEL) && 557 if (type == InputHandler::WHEEL || type == InputHandler::ANIMATED_WHEEL) {
558 layer_tree_impl_->have_wheel_event_handlers()) { 558 EventListenerProperties event_properties =
559 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers"); 559 layer_tree_impl_->event_listener_properties(
560 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; 560 EventListenerClass::kMouseWheel);
561 scroll_status.main_thread_scrolling_reasons = 561 if (event_properties == EventListenerProperties::kBlocking ||
562 MainThreadScrollingReason::kEventHandlers; 562 (!layer_tree_impl_->settings().use_mouse_wheel_gestures &&
563 return scroll_status; 563 event_properties == EventListenerProperties::kPassive)) {
564 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers");
565 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD;
566 scroll_status.main_thread_scrolling_reasons =
567 MainThreadScrollingReason::kEventHandlers;
568 return scroll_status;
569 }
564 } 570 }
565 571
566 if (!scrollable()) { 572 if (!scrollable()) {
567 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable"); 573 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable");
568 scroll_status.thread = InputHandler::SCROLL_IGNORED; 574 scroll_status.thread = InputHandler::SCROLL_IGNORED;
569 scroll_status.main_thread_scrolling_reasons = 575 scroll_status.main_thread_scrolling_reasons =
570 MainThreadScrollingReason::kNotScrollable; 576 MainThreadScrollingReason::kNotScrollable;
571 return scroll_status; 577 return scroll_status;
572 } 578 }
573 579
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 .layer_transforms_should_scale_layer_contents) { 1913 .layer_transforms_should_scale_layer_contents) {
1908 return default_scale; 1914 return default_scale;
1909 } 1915 }
1910 1916
1911 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1917 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1912 DrawTransform(), default_scale); 1918 DrawTransform(), default_scale);
1913 return std::max(transform_scales.x(), transform_scales.y()); 1919 return std::max(transform_scales.x(), transform_scales.y());
1914 } 1920 }
1915 1921
1916 } // namespace cc 1922 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/proto/layer_tree_host.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698