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

Unified Diff: cc/trees/layer_tree_host_unittest_copyrequest.cc

Issue 1905713002: cc: Remove LayerImpl::children() calls from descendants of LayerTreeTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments Created 4 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_unittest_context.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_copyrequest.cc
diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc
index 4248dd5d4f5fcec49f087ec698389690b204757b..c61ba27b3cf5525adab47a0e42e722629abc147a 100644
--- a/cc/trees/layer_tree_host_unittest_copyrequest.cc
+++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc
@@ -478,10 +478,10 @@ class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest
void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
Renderer* renderer = host_impl->renderer();
- LayerImpl* root = host_impl->active_tree()->root_layer();
- LayerImpl* grand_parent = root->children()[0];
- LayerImpl* parent = grand_parent->children()[0];
- LayerImpl* copy_layer = parent->children()[0];
+ LayerImpl* parent =
+ host_impl->active_tree()->LayerById(parent_layer_->id());
+ LayerImpl* copy_layer =
+ host_impl->active_tree()->LayerById(copy_layer_->id());
// |parent| owns a surface, but it was hidden and not part of the copy
// request so it should not allocate any resource.
@@ -654,8 +654,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw
void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
if (impl->active_tree()->source_frame_number() == 0) {
- LayerImpl* root = impl->active_tree()->root_layer();
- EXPECT_TRUE(root->children()[0]->HasCopyRequest());
+ EXPECT_TRUE(impl->active_tree()->LayerById(copy_layer_->id()));
saw_copy_request_ = true;
}
}
@@ -1193,7 +1192,7 @@ class LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest
LayerTreeHostImpl::FrameData* frame_data,
DrawResult draw_result) override {
LayerImpl* root = host_impl->active_tree()->root_layer();
- LayerImpl* child = root->children()[0];
+ LayerImpl* child = host_impl->active_tree()->LayerById(child_->id());
bool saw_root = false;
bool saw_child = false;
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698