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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2401853003: CL for src perf tryjob to run smoothness.scrolling_tough_ad_cases benchmark on android-nexus5X plat… (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/input/scroll_state_data.cc ('k') | content/browser/renderer_host/input/gesture_event_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index d47f504871741c890f5daf7280c13c7412cf7e2e..4c4feea30c50c09813c157a918fb3e8ab834bf45 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2643,43 +2643,41 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
scroll_status.main_thread_scrolling_reasons =
MainThreadScrollingReason::kNotScrollingOnMain;
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
-
+ bool scroll_on_main_thread = false;
+ LayerImpl* scrolling_layer_impl;
// On Mac a scroll begin with |inertial_phase| = true happens to handle a
// fling.
- if (scroll_state->is_in_inertial_phase())
- return FlingScrollBegin();
-
- ClearCurrentlyScrollingLayer();
-
- gfx::Point viewport_point(scroll_state->position_x(),
- scroll_state->position_y());
-
- gfx::PointF device_viewport_point = gfx::ScalePoint(
- gfx::PointF(viewport_point), active_tree_->device_scale_factor());
- LayerImpl* layer_impl =
- active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
+ if (scroll_state->is_in_inertial_phase()) {
+ scrolling_layer_impl = CurrentlyScrollingLayer();
+ } else {
+ ClearCurrentlyScrollingLayer();
- if (layer_impl) {
- LayerImpl* scroll_layer_impl =
- active_tree_->FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
- device_viewport_point);
- if (scroll_layer_impl &&
- !HasScrollAncestor(layer_impl, scroll_layer_impl)) {
- scroll_status.thread = SCROLL_UNKNOWN;
- scroll_status.main_thread_scrolling_reasons =
- MainThreadScrollingReason::kFailedHitTest;
- return scroll_status;
+ gfx::Point viewport_point(scroll_state->position_x(),
+ scroll_state->position_y());
+ gfx::PointF device_viewport_point = gfx::ScalePoint(
+ gfx::PointF(viewport_point), active_tree_->device_scale_factor());
+ LayerImpl* layer_impl =
+ active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
+ if (layer_impl) {
+ LayerImpl* scroll_layer_impl =
+ active_tree_->FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
+ device_viewport_point);
+ if (scroll_layer_impl &&
+ !HasScrollAncestor(layer_impl, scroll_layer_impl)) {
+ scroll_status.thread = SCROLL_UNKNOWN;
+ scroll_status.main_thread_scrolling_reasons =
+ MainThreadScrollingReason::kFailedHitTest;
+ return scroll_status;
+ }
}
- }
-
- bool scroll_on_main_thread = false;
- LayerImpl* scrolling_layer_impl = FindScrollLayerForDeviceViewportPoint(
- device_viewport_point, type, layer_impl, &scroll_on_main_thread,
- &scroll_status.main_thread_scrolling_reasons);
+ scrolling_layer_impl = FindScrollLayerForDeviceViewportPoint(
+ device_viewport_point, type, layer_impl, &scroll_on_main_thread,
+ &scroll_status.main_thread_scrolling_reasons);
- if (scrolling_layer_impl)
- scroll_affects_scroll_handler_ =
- scrolling_layer_impl->layer_tree_impl()->have_scroll_event_handlers();
+ if (scrolling_layer_impl)
+ scroll_affects_scroll_handler_ =
+ scrolling_layer_impl->layer_tree_impl()->have_scroll_event_handlers();
+ }
if (scroll_on_main_thread) {
RecordCompositorSlowScrollMetric(type, MAIN_THREAD);
@@ -3178,9 +3176,8 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) {
DistributeScrollDelta(scroll_state);
top_controls_manager_->ScrollEnd();
- if (scroll_state->is_in_inertial_phase()) {
+ if (!scroll_state->data()->fling_might_happen_next) {
// Only clear the currently scrolling layer if we know the scroll is done.
- // A non-inertial scroll end could be followed by an inertial scroll.
ClearCurrentlyScrollingLayer();
}
}
« no previous file with comments | « cc/input/scroll_state_data.cc ('k') | content/browser/renderer_host/input/gesture_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698