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

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: Address reviewer comments 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
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 9d04554dcc57cf6d22f6eb4c4bfcac65ad194d65..219d02d1e182841eadcd61d33684a8ec361d683a 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3453,9 +3453,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
if (!new_animation_controller)
return;
- int new_layer_id = active_tree_->LayerIdByElementId(new_element_id);
- for (ScrollbarLayerImplBase* scrollbar :
- active_tree_->ScrollbarsFor(new_layer_id)) {
+ for (auto* scrollbar : active_tree_->ScrollbarsFor(new_element_id)) {
new_animation_controller->DidMouseMoveNear(
scrollbar->orientation(),
DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar) /
@@ -3681,14 +3679,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(
@@ -3729,8 +3726,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(

Powered by Google App Engine
This is Rietveld 408576698