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

Side by Side Diff: cc/test/layer_test_common.h

Issue 1505243003: Revert of Create RenderSurface on Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alwayspt
Patch Set: rebase Created 5 years 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/video_layer_impl_unittest.cc ('k') | cc/test/layer_tree_host_common_test.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ 5 #ifndef CC_TEST_LAYER_TEST_COMMON_H_
6 #define CC_TEST_LAYER_TEST_COMMON_H_ 6 #define CC_TEST_LAYER_TEST_COMMON_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 template <typename T> 64 template <typename T>
65 T* AddChild(LayerImpl* parent) { 65 T* AddChild(LayerImpl* parent) {
66 scoped_ptr<T> layer = 66 scoped_ptr<T> layer =
67 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++); 67 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++);
68 T* ptr = layer.get(); 68 T* ptr = layer.get();
69 parent->AddChild(std::move(layer)); 69 parent->AddChild(std::move(layer));
70 return ptr; 70 return ptr;
71 } 71 }
72 72
73 template <typename T>
74 T* AddReplicaLayer(LayerImpl* origin) {
75 scoped_ptr<T> layer =
76 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++);
77 T* ptr = layer.get();
78 origin->SetReplicaLayer(layer.Pass());
79 return ptr;
80 }
81
82 template <typename T, typename A> 73 template <typename T, typename A>
83 T* AddChildToRoot(const A& a) { 74 T* AddChildToRoot(const A& a) {
84 scoped_ptr<T> layer = 75 scoped_ptr<T> layer =
85 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a); 76 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a);
86 T* ptr = layer.get(); 77 T* ptr = layer.get();
87 root_layer_impl_->AddChild(std::move(layer)); 78 root_layer_impl_->AddChild(std::move(layer));
88 return ptr; 79 return ptr;
89 } 80 }
90 81
91 template <typename T, typename A, typename B> 82 template <typename T, typename A, typename B>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 scoped_ptr<FakeLayerTreeHost> host_; 145 scoped_ptr<FakeLayerTreeHost> host_;
155 scoped_ptr<LayerImpl> root_layer_impl_; 146 scoped_ptr<LayerImpl> root_layer_impl_;
156 scoped_ptr<RenderPass> render_pass_; 147 scoped_ptr<RenderPass> render_pass_;
157 int layer_impl_id_; 148 int layer_impl_id_;
158 }; 149 };
159 }; 150 };
160 151
161 } // namespace cc 152 } // namespace cc
162 153
163 #endif // CC_TEST_LAYER_TEST_COMMON_H_ 154 #endif // CC_TEST_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/layers/video_layer_impl_unittest.cc ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698