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

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix call site in cc_perftest. Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 4853 matching lines...) Expand 10 before | Expand all | Expand 10 after
4864 scoped_refptr<Layer> replica_layer = Layer::Create(); 4864 scoped_refptr<Layer> replica_layer = Layer::Create();
4865 4865
4866 grand_child->SetReplicaLayer(replica_layer.get()); 4866 grand_child->SetReplicaLayer(replica_layer.get());
4867 child->AddChild(grand_child.get()); 4867 child->AddChild(grand_child.get());
4868 child->SetMaskLayer(mask_layer.get()); 4868 child->SetMaskLayer(mask_layer.get());
4869 root->AddChild(child.get()); 4869 root->AddChild(child.get());
4870 4870
4871 host()->SetRootLayer(root); 4871 host()->SetRootLayer(root);
4872 4872
4873 int nonexistent_id = -1; 4873 int nonexistent_id = -1;
4874 EXPECT_EQ(root.get(), host()->LayerById(root->id())); 4874 LayerTree* layer_tree = host()->GetLayerTree();
4875 EXPECT_EQ(child.get(), host()->LayerById(child->id())); 4875 EXPECT_EQ(root.get(), layer_tree->LayerById(root->id()));
4876 EXPECT_EQ(grand_child.get(), host()->LayerById(grand_child->id())); 4876 EXPECT_EQ(child.get(), layer_tree->LayerById(child->id()));
4877 EXPECT_EQ(mask_layer.get(), host()->LayerById(mask_layer->id())); 4877 EXPECT_EQ(grand_child.get(), layer_tree->LayerById(grand_child->id()));
4878 EXPECT_EQ(replica_layer.get(), host()->LayerById(replica_layer->id())); 4878 EXPECT_EQ(mask_layer.get(), layer_tree->LayerById(mask_layer->id()));
4879 EXPECT_FALSE(host()->LayerById(nonexistent_id)); 4879 EXPECT_EQ(replica_layer.get(), layer_tree->LayerById(replica_layer->id()));
4880 EXPECT_FALSE(layer_tree->LayerById(nonexistent_id));
4880 } 4881 }
4881 4882
4882 TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) { 4883 TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) {
4883 LayerImpl* root = root_layer_for_testing(); 4884 LayerImpl* root = root_layer_for_testing();
4884 LayerImpl* child = AddChild<LayerImpl>(root); 4885 LayerImpl* child = AddChild<LayerImpl>(root);
4885 LayerImpl* grand_child = AddChild<LayerImpl>(child); 4886 LayerImpl* grand_child = AddChild<LayerImpl>(child);
4886 4887
4887 root->SetBounds(gfx::Size(100, 100)); 4888 root->SetBounds(gfx::Size(100, 100));
4888 child->SetBounds(gfx::Size(10, 10)); 4889 child->SetBounds(gfx::Size(10, 10));
4889 child->test_properties()->opacity = 0.5f; 4890 child->test_properties()->opacity = 0.5f;
(...skipping 4822 matching lines...) Expand 10 before | Expand all | Expand 10 after
9712 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 9713 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
9713 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 9714 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
9714 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 9715 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
9715 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 9716 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
9716 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 9717 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
9717 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 9718 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
9718 } 9719 }
9719 9720
9720 } // namespace 9721 } // namespace
9721 } // namespace cc 9722 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698