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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2683763004: Pass MouseUp to the captured scrollbar animation controller in layer tree (Closed)
Patch Set: record captured_animation_controller_ for mouse up Created 3 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 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 ecf60cf97cc12578d03d7175fa08acc1dd916b00..b8c189b26dcf27ed7b5edf5fa50f394d6012e0c9 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -247,6 +247,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
max_memory_needed_bytes_(0),
resourceless_software_draw_(false),
mutator_host_(std::move(mutator_host)),
+ captured_animation_controller_(nullptr),
rendering_stats_instrumentation_(rendering_stats_instrumentation),
micro_benchmark_controller_(this),
task_graph_runner_(task_graph_runner),
@@ -3235,15 +3236,17 @@ float LayerTreeHostImpl::DeviceSpaceDistanceToLayer(
void LayerTreeHostImpl::MouseDown() {
ScrollbarAnimationController* animation_controller =
ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
- if (animation_controller)
+ if (animation_controller) {
animation_controller->DidMouseDown();
+ captured_animation_controller_ = animation_controller;
+ }
}
void LayerTreeHostImpl::MouseUp() {
- ScrollbarAnimationController* animation_controller =
- ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
- if (animation_controller)
- animation_controller->DidMouseUp();
+ if (captured_animation_controller_) {
+ captured_animation_controller_->DidMouseUp();
+ captured_animation_controller_ = nullptr;
+ }
}
void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {

Powered by Google App Engine
This is Rietveld 408576698