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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2554913002: Prevent overlay scrollbars expand or hover together (Closed)
Patch Set: add ScrollbarAnimationControllerThinningTest Created 4 years 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
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 d33bc071c19154d554fab3271911b395dd7b9702..aa88c90c9e1684f6d996c30f08979d5dadd96e67 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1660,7 +1660,6 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
}
}
-
CompositorFrame compositor_frame;
compositor_frame.metadata = std::move(metadata);
resource_provider_->PrepareSendToParent(resources,
@@ -3230,7 +3229,6 @@ void LayerTreeHostImpl::MouseUp() {
}
void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
- float distance_to_scrollbar = std::numeric_limits<float>::max();
gfx::PointF device_viewport_point = gfx::ScalePoint(
gfx::PointF(viewport_point), active_tree_->device_scale_factor());
LayerImpl* layer_impl =
@@ -3243,10 +3241,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
int new_id = Layer::INVALID_ID;
if (layer_impl && layer_impl->ToScrollbarLayer())
new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId();
- if (new_id != Layer::INVALID_ID) {
- // Mouse over a scrollbar.
- distance_to_scrollbar = 0;
- } else {
+ if (new_id == Layer::INVALID_ID) {
bool scroll_on_main_thread = false;
uint32_t main_thread_scrolling_reasons;
LayerImpl* scroll_layer_impl = FindScrollLayerForDeviceViewportPoint(
@@ -3275,12 +3270,12 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
if (!new_animation_controller)
return;
- for (ScrollbarLayerImplBase* scrollbar : ScrollbarsFor(new_id))
- distance_to_scrollbar =
- std::min(distance_to_scrollbar,
- DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar));
- new_animation_controller->DidMouseMoveNear(
- distance_to_scrollbar / active_tree_->device_scale_factor());
+ for (ScrollbarLayerImplBase* scrollbar : ScrollbarsFor(new_id)) {
+ new_animation_controller->DidMouseMoveNear(
+ scrollbar->orientation(),
+ DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar) /
bokan 2016/12/08 19:34:07 Will this return 0 if the mouse is over the scroll
chaopeng 2016/12/15 23:54:26 Yes
+ active_tree_->device_scale_factor());
+ }
}
void LayerTreeHostImpl::MouseLeave() {

Powered by Google App Engine
This is Rietveld 408576698