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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 1952413002: cc: Remove remaining calls to LayerImpl::child_at in LayerTreeTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 4990ee2bd6eb33b44ed446141d71e487120fd409..ca83ded86a3dd638c38ed3ffce26ebb6ba9f227d 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -1354,21 +1354,30 @@ class LayerTreeHostScrollTestLayerStructureChange
Layer* root_scroll_layer =
CreateScrollLayer(outer_scroll_layer, &root_scroll_layer_client_);
- CreateScrollLayer(outer_scroll_layer, &sibling_scroll_layer_client_);
- CreateScrollLayer(root_scroll_layer, &child_scroll_layer_client_);
+ Layer* sibling_scroll_layer =
+ CreateScrollLayer(outer_scroll_layer, &sibling_scroll_layer_client_);
+ Layer* child_scroll_layer =
+ CreateScrollLayer(root_scroll_layer, &child_scroll_layer_client_);
+ root_scroll_layer_id_ = root_scroll_layer->id();
+ sibling_scroll_layer_id_ = sibling_scroll_layer->id();
+ child_scroll_layer_id_ = child_scroll_layer->id();
fake_content_layer_client_.set_bounds(root_layer->bounds());
}
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
- LayerImpl* root = impl->OuterViewportScrollLayer();
switch (impl->active_tree()->source_frame_number()) {
case 0:
- SetScrollOffsetDelta(root->child_at(0), gfx::Vector2dF(5, 5));
- SetScrollOffsetDelta(root->child_at(0)->child_at(0),
- gfx::Vector2dF(5, 5));
- SetScrollOffsetDelta(root->child_at(1), gfx::Vector2dF(5, 5));
+ SetScrollOffsetDelta(
+ impl->active_tree()->LayerById(root_scroll_layer_id_),
+ gfx::Vector2dF(5, 5));
+ SetScrollOffsetDelta(
+ impl->active_tree()->LayerById(child_scroll_layer_id_),
+ gfx::Vector2dF(5, 5));
+ SetScrollOffsetDelta(
+ impl->active_tree()->LayerById(sibling_scroll_layer_id_),
+ gfx::Vector2dF(5, 5));
PostSetNeedsCommitToMainThread();
break;
case 1:
@@ -1429,6 +1438,9 @@ class LayerTreeHostScrollTestLayerStructureChange
FakeLayerScrollClient root_scroll_layer_client_;
FakeLayerScrollClient sibling_scroll_layer_client_;
FakeLayerScrollClient child_scroll_layer_client_;
+ int root_scroll_layer_id_;
+ int sibling_scroll_layer_id_;
+ int child_scroll_layer_id_;
FakeContentLayerClient fake_content_layer_client_;
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698