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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1878323002: cc: Scroll on main when possible incorrect hit testing hits scrollbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure the unit test fails without the patch Created 4 years, 8 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/trees/layer_tree_host_impl_unittest.cc » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2664 gfx::Point viewport_point(scroll_state->start_position_x(), 2664 gfx::Point viewport_point(scroll_state->start_position_x(),
2665 scroll_state->start_position_y()); 2665 scroll_state->start_position_y());
2666 2666
2667 gfx::PointF device_viewport_point = gfx::ScalePoint( 2667 gfx::PointF device_viewport_point = gfx::ScalePoint(
2668 gfx::PointF(viewport_point), active_tree_->device_scale_factor()); 2668 gfx::PointF(viewport_point), active_tree_->device_scale_factor());
2669 LayerImpl* layer_impl = 2669 LayerImpl* layer_impl =
2670 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); 2670 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
2671 2671
2672 if (layer_impl) { 2672 if (layer_impl) {
2673 LayerImpl* scroll_layer_impl = 2673 LayerImpl* scroll_layer_impl =
2674 active_tree_->FindFirstScrollingLayerThatIsHitByPoint( 2674 active_tree_->FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
2675 device_viewport_point); 2675 device_viewport_point);
2676 if (scroll_layer_impl && 2676 if (scroll_layer_impl &&
2677 !HasScrollAncestor(layer_impl, scroll_layer_impl)) { 2677 !HasScrollAncestor(layer_impl, scroll_layer_impl)) {
2678 scroll_status.thread = SCROLL_UNKNOWN; 2678 scroll_status.thread = SCROLL_UNKNOWN;
2679 scroll_status.main_thread_scrolling_reasons = 2679 scroll_status.main_thread_scrolling_reasons =
2680 MainThreadScrollingReason::kFailedHitTest; 2680 MainThreadScrollingReason::kFailedHitTest;
2681 return scroll_status; 2681 return scroll_status;
2682 } 2682 }
2683 } 2683 }
2684 2684
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
3976 return task_runner_provider_->HasImplThread(); 3976 return task_runner_provider_->HasImplThread();
3977 } 3977 }
3978 3978
3979 bool LayerTreeHostImpl::CommitToActiveTree() const { 3979 bool LayerTreeHostImpl::CommitToActiveTree() const {
3980 // In single threaded mode we skip the pending tree and commit directly to the 3980 // In single threaded mode we skip the pending tree and commit directly to the
3981 // active tree. 3981 // active tree.
3982 return !task_runner_provider_->HasImplThread(); 3982 return !task_runner_provider_->HasImplThread();
3983 } 3983 }
3984 3984
3985 } // namespace cc 3985 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698