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

Side by Side Diff: cc/layers/layer_utils_unittest.cc

Issue 2084233002: cc: Move LayerImpl::AddChild and RemoveChild to LayerImplTestProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layers/layer_utils.h" 5 #include "cc/layers/layer_utils.h"
6 6
7 #include "cc/animation/animation_host.h" 7 #include "cc/animation/animation_host.h"
8 #include "cc/animation/animation_id_provider.h" 8 #include "cc/animation/animation_id_provider.h"
9 #include "cc/animation/transform_operations.h" 9 #include "cc/animation/transform_operations.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 LayerImpl* great_grand_child() { return great_grand_child_; } 52 LayerImpl* great_grand_child() { return great_grand_child_; }
53 53
54 scoped_refptr<AnimationTimeline> timeline() { return timeline_; } 54 scoped_refptr<AnimationTimeline> timeline() { return timeline_; }
55 FakeLayerTreeHostImpl& host_impl() { return host_impl_; } 55 FakeLayerTreeHostImpl& host_impl() { return host_impl_; }
56 56
57 private: 57 private:
58 static LayerImpl* CreateTwoForkTree(LayerTreeHostImpl* host_impl) { 58 static LayerImpl* CreateTwoForkTree(LayerTreeHostImpl* host_impl) {
59 std::unique_ptr<LayerImpl> root = 59 std::unique_ptr<LayerImpl> root =
60 LayerImpl::Create(host_impl->active_tree(), 1); 60 LayerImpl::Create(host_impl->active_tree(), 1);
61 LayerImpl* root_ptr = root.get(); 61 LayerImpl* root_ptr = root.get();
62 root->AddChild(LayerImpl::Create(host_impl->active_tree(), 2)); 62 root->test_properties()->AddChild(
63 root->test_properties()->children[0]->AddChild( 63 LayerImpl::Create(host_impl->active_tree(), 2));
64 root->test_properties()->children[0]->test_properties()->AddChild(
64 LayerImpl::Create(host_impl->active_tree(), 3)); 65 LayerImpl::Create(host_impl->active_tree(), 3));
65 root->AddChild(LayerImpl::Create(host_impl->active_tree(), 4)); 66 root->test_properties()->AddChild(
66 root->test_properties()->children[1]->AddChild( 67 LayerImpl::Create(host_impl->active_tree(), 4));
68 root->test_properties()->children[1]->test_properties()->AddChild(
67 LayerImpl::Create(host_impl->active_tree(), 5)); 69 LayerImpl::Create(host_impl->active_tree(), 5));
68 root->test_properties() 70 root->test_properties()
69 ->children[1] 71 ->children[1]
70 ->test_properties() 72 ->test_properties()
71 ->children[0] 73 ->children[0]
74 ->test_properties()
72 ->AddChild(LayerImpl::Create(host_impl->active_tree(), 6)); 75 ->AddChild(LayerImpl::Create(host_impl->active_tree(), 6));
73 root->test_properties() 76 root->test_properties()
74 ->children[1] 77 ->children[1]
75 ->test_properties() 78 ->test_properties()
76 ->children[0] 79 ->children[0]
77 ->test_properties() 80 ->test_properties()
78 ->children[0] 81 ->children[0]
82 ->test_properties()
79 ->AddChild(LayerImpl::Create(host_impl->active_tree(), 7)); 83 ->AddChild(LayerImpl::Create(host_impl->active_tree(), 7));
80 host_impl->active_tree()->SetRootLayer(std::move(root)); 84 host_impl->active_tree()->SetRootLayer(std::move(root));
81 return root_ptr; 85 return root_ptr;
82 } 86 }
83 87
84 FakeImplTaskRunnerProvider task_runner_provider_; 88 FakeImplTaskRunnerProvider task_runner_provider_;
85 TestSharedBitmapManager shared_bitmap_manager_; 89 TestSharedBitmapManager shared_bitmap_manager_;
86 TestTaskGraphRunner task_graph_runner_; 90 TestTaskGraphRunner task_graph_runner_;
87 FakeLayerTreeHostImpl host_impl_; 91 FakeLayerTreeHostImpl host_impl_;
88 LayerImpl* root_; 92 LayerImpl* root_;
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 // Same as RotateXWithPerspectiveUnderAncestorsWithPositionOr2DTransform test, 574 // Same as RotateXWithPerspectiveUnderAncestorsWithPositionOr2DTransform test,
571 // except for the perspective calculations. 575 // except for the perspective calculations.
572 576
573 gfx::BoxF expected(295.f, 180.f, -25.f, 50.f, 50.f, 50.f); 577 gfx::BoxF expected(295.f, 180.f, -25.f, 50.f, 50.f, 50.f);
574 EXPECT_BOXF_EQ(expected, box); 578 EXPECT_BOXF_EQ(expected, box);
575 } 579 }
576 580
577 } // namespace 581 } // namespace
578 582
579 } // namespace cc 583 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698