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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2703823002: Record scroll_layer_id instead of scrollbar_animation_controller pointer (Closed)
Patch Set: rebase 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.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 75194f6628628b5b8c7a27940422183a691cd0ad..1759689eeab648bd103bd4c43ae1f6621e8bfcc3 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -222,6 +222,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
wheel_scrolling_(false),
scroll_affects_scroll_handler_(false),
scroll_layer_id_mouse_currently_over_(Layer::INVALID_ID),
+ scroll_layer_id_mouse_currently_captured_(Layer::INVALID_ID),
tile_priorities_dirty_(false),
settings_(settings),
visible_(false),
@@ -246,7 +247,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(
max_memory_needed_bytes_(0),
resourceless_software_draw_(false),
mutator_host_(std::move(mutator_host)),
- captured_scrollbar_animation_controller_(nullptr),
rendering_stats_instrumentation_(rendering_stats_instrumentation),
micro_benchmark_controller_(this),
task_graph_runner_(task_graph_runner),
@@ -3266,14 +3266,21 @@ void LayerTreeHostImpl::MouseDown() {
ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
if (animation_controller) {
animation_controller->DidMouseDown();
- captured_scrollbar_animation_controller_ = animation_controller;
+ scroll_layer_id_mouse_currently_captured_ =
+ scroll_layer_id_mouse_currently_over_;
}
}
void LayerTreeHostImpl::MouseUp() {
- if (captured_scrollbar_animation_controller_) {
- captured_scrollbar_animation_controller_->DidMouseUp();
- captured_scrollbar_animation_controller_ = nullptr;
+ if (scroll_layer_id_mouse_currently_captured_ != Layer::INVALID_ID) {
+ ScrollbarAnimationController* animation_controller =
+ ScrollbarAnimationControllerForId(
+ scroll_layer_id_mouse_currently_captured_);
+
+ scroll_layer_id_mouse_currently_captured_ = Layer::INVALID_ID;
+
+ if (animation_controller)
+ animation_controller->DidMouseUp();
}
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698