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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 1720023002: Wheel scrolling with smooth scrolling enabled would cause an extra animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 blink::WebGestureEvent::ScrollUnits::Page) { 590 blink::WebGestureEvent::ScrollUnits::Page) {
591 scroll_status.thread = cc::InputHandler::SCROLL_ON_MAIN_THREAD; 591 scroll_status.thread = cc::InputHandler::SCROLL_ON_MAIN_THREAD;
592 scroll_status.main_thread_scrolling_reasons = 592 scroll_status.main_thread_scrolling_reasons =
593 cc::MainThreadScrollingReason::kContinuingMainThreadScroll; 593 cc::MainThreadScrollingReason::kContinuingMainThreadScroll;
594 } else if (gesture_event.data.scrollBegin.targetViewport) { 594 } else if (gesture_event.data.scrollBegin.targetViewport) {
595 scroll_status = input_handler_->RootScrollBegin(&scroll_state, 595 scroll_status = input_handler_->RootScrollBegin(&scroll_state,
596 cc::InputHandler::GESTURE); 596 cc::InputHandler::GESTURE);
597 } else if (smooth_scroll_enabled_ && 597 } else if (smooth_scroll_enabled_ &&
598 gesture_event.data.scrollBegin.deltaHintUnits == 598 gesture_event.data.scrollBegin.deltaHintUnits ==
599 blink::WebGestureEvent::ScrollUnits::Pixels) { 599 blink::WebGestureEvent::ScrollUnits::Pixels) {
600 gfx::Vector2dF scroll_delta(-gesture_event.data.scrollBegin.deltaXHint,
601 -gesture_event.data.scrollBegin.deltaYHint);
602 scroll_status = input_handler_->ScrollAnimated( 600 scroll_status = input_handler_->ScrollAnimated(
603 gfx::Point(gesture_event.x, gesture_event.y), scroll_delta); 601 gfx::Point(gesture_event.x, gesture_event.y), gfx::Vector2dF());
tdresser 2016/02/22 20:14:49 Does this need to be a ScrollAnimated? Can we just
dtapuska 2016/02/22 20:15:59 I first attempted to do that and since a scroll an
ymalik 2016/02/22 20:35:32 Why do we need this branch to begin with if we're
dtapuska 2016/02/22 20:39:03 ScrollAnimated is successful; but the next ScrollA
604 } else { 602 } else {
605 scroll_status = 603 scroll_status =
606 input_handler_->ScrollBegin(&scroll_state, cc::InputHandler::GESTURE); 604 input_handler_->ScrollBegin(&scroll_state, cc::InputHandler::GESTURE);
607 } 605 }
608 UMA_HISTOGRAM_ENUMERATION("Renderer4.CompositorScrollHitTestResult", 606 UMA_HISTOGRAM_ENUMERATION("Renderer4.CompositorScrollHitTestResult",
609 scroll_status.thread, 607 scroll_status.thread,
610 cc::InputHandler::LAST_SCROLL_STATUS + 1); 608 cc::InputHandler::LAST_SCROLL_STATUS + 1);
611 609
612 RecordMainThreadScrollingReasons(gesture_event.type, 610 RecordMainThreadScrollingReasons(gesture_event.type,
613 scroll_status.main_thread_scrolling_reasons); 611 scroll_status.main_thread_scrolling_reasons);
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 // trigger a scroll, e.g., with a trivial time delta between fling updates. 1294 // trigger a scroll, e.g., with a trivial time delta between fling updates.
1297 // Return true in this case to prevent early fling termination. 1295 // Return true in this case to prevent early fling termination.
1298 if (std::abs(clipped_increment.width) < kScrollEpsilon && 1296 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
1299 std::abs(clipped_increment.height) < kScrollEpsilon) 1297 std::abs(clipped_increment.height) < kScrollEpsilon)
1300 return true; 1298 return true;
1301 1299
1302 return did_scroll; 1300 return did_scroll;
1303 } 1301 }
1304 1302
1305 } // namespace ui 1303 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698