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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2824693002: Refactor LayerTreeImpl's scrollbar map to be keyed on element ids (Closed)
Patch Set: rebase Created 3 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 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 c3005c8a4bfaa15b1db877b8618f0f341f2d64fc..bd017fa76e943d1f197ff3c1d39f7f46d50794b8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3444,9 +3444,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
if (!new_animation_controller)
return;
- int scroll_layer_id = active_tree_->LayerIdByElementId(scroll_element_id);
- for (ScrollbarLayerImplBase* scrollbar :
- active_tree_->ScrollbarsFor(scroll_layer_id)) {
+ for (auto* scrollbar : active_tree_->ScrollbarsFor(scroll_element_id)) {
new_animation_controller->DidMouseMoveNear(
scrollbar->orientation(),
DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar) /
@@ -3672,14 +3670,13 @@ std::string LayerTreeHostImpl::LayerTreeAsJson() const {
}
void LayerTreeHostImpl::RegisterScrollbarAnimationController(
- int scroll_layer_id,
ElementId scroll_element_id) {
if (settings().scrollbar_animator == LayerTreeSettings::NO_ANIMATOR)
return;
if (ScrollbarAnimationControllerForElementId(scroll_element_id))
return;
scrollbar_animation_controllers_[scroll_element_id] =
- active_tree_->CreateScrollbarAnimationController(scroll_layer_id);
+ active_tree_->CreateScrollbarAnimationController(scroll_element_id);
}
void LayerTreeHostImpl::UnregisterScrollbarAnimationController(
@@ -3720,8 +3717,8 @@ void LayerTreeHostImpl::SetNeedsRedrawForScrollbarAnimation() {
SetNeedsRedraw();
}
-ScrollbarSet LayerTreeHostImpl::ScrollbarsFor(int scroll_layer_id) const {
- return active_tree_->ScrollbarsFor(scroll_layer_id);
+ScrollbarSet LayerTreeHostImpl::ScrollbarsFor(ElementId id) const {
+ return active_tree_->ScrollbarsFor(id);
}
void LayerTreeHostImpl::AddVideoFrameController(
« 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