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

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

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 unified diff | Download patch
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 "base/thread_task_runner_handle.h" 5 #include "base/thread_task_runner_handle.h"
6 #include "base/threading/simple_thread.h" 6 #include "base/threading/simple_thread.h"
7 #include "cc/layers/delegated_frame_provider.h" 7 #include "cc/layers/delegated_frame_provider.h"
8 #include "cc/layers/delegated_frame_resource_collection.h" 8 #include "cc/layers/delegated_frame_resource_collection.h"
9 #include "cc/layers/delegated_renderer_layer.h" 9 #include "cc/layers/delegated_renderer_layer.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 class LayerTreeHostNoMessageLoopSmokeTest 145 class LayerTreeHostNoMessageLoopSmokeTest
146 : public LayerTreeHostNoMessageLoopTest { 146 : public LayerTreeHostNoMessageLoopTest {
147 protected: 147 protected:
148 void RunTestWithoutMessageLoop() override { 148 void RunTestWithoutMessageLoop() override {
149 gfx::Size size(100, 100); 149 gfx::Size size(100, 100);
150 150
151 // Set up root layer. 151 // Set up root layer.
152 { 152 {
153 scoped_refptr<SolidColorLayer> solid_color_layer = 153 scoped_refptr<SolidColorLayer> solid_color_layer =
154 SolidColorLayer::Create(); 154 SolidColorLayer::Create(LayerSettings());
155 solid_color_layer->SetBackgroundColor(SK_ColorRED); 155 solid_color_layer->SetBackgroundColor(SK_ColorRED);
156 solid_color_layer->SetBounds(size_); 156 solid_color_layer->SetBounds(size_);
157 solid_color_layer->SetIsDrawable(true); 157 solid_color_layer->SetIsDrawable(true);
158 root_layer_ = solid_color_layer; 158 root_layer_ = solid_color_layer;
159 } 159 }
160 160
161 SetupLayerTreeHost(); 161 SetupLayerTreeHost();
162 Composite(); 162 Composite();
163 TearDownLayerTreeHost(); 163 TearDownLayerTreeHost();
164 } 164 }
165 }; 165 };
166 166
167 TEST_F(LayerTreeHostNoMessageLoopSmokeTest, SmokeTest) { 167 TEST_F(LayerTreeHostNoMessageLoopSmokeTest, SmokeTest) {
168 RunTest(); 168 RunTest();
169 } 169 }
170 170
171 class LayerTreeHostNoMessageLoopDelegatedLayer 171 class LayerTreeHostNoMessageLoopDelegatedLayer
172 : public LayerTreeHostNoMessageLoopTest, 172 : public LayerTreeHostNoMessageLoopTest,
173 public DelegatedFrameResourceCollectionClient { 173 public DelegatedFrameResourceCollectionClient {
174 protected: 174 protected:
175 void RunTestWithoutMessageLoop() override { 175 void RunTestWithoutMessageLoop() override {
176 resource_collection_ = new DelegatedFrameResourceCollection; 176 resource_collection_ = new DelegatedFrameResourceCollection;
177 frame_provider_ = new DelegatedFrameProvider( 177 frame_provider_ = new DelegatedFrameProvider(
178 resource_collection_.get(), CreateFrameDataWithResource(998)); 178 resource_collection_.get(), CreateFrameDataWithResource(998));
179 179
180 root_layer_ = Layer::Create(); 180 LayerSettings layer_settings;
181 delegated_layer_ = 181 root_layer_ = Layer::Create(layer_settings);
182 FakeDelegatedRendererLayer::Create(frame_provider_.get()); 182 delegated_layer_ = FakeDelegatedRendererLayer::Create(
183 layer_settings, frame_provider_.get());
183 delegated_layer_->SetBounds(size_); 184 delegated_layer_->SetBounds(size_);
184 delegated_layer_->SetIsDrawable(true); 185 delegated_layer_->SetIsDrawable(true);
185 root_layer_->AddChild(delegated_layer_); 186 root_layer_->AddChild(delegated_layer_);
186 187
187 SetupLayerTreeHost(); 188 SetupLayerTreeHost();
188 189
189 // Draw first frame. 190 // Draw first frame.
190 Composite(); 191 Composite();
191 192
192 // Prepare and draw second frame. 193 // Prepare and draw second frame.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 scoped_refptr<DelegatedFrameProvider> frame_provider_; 240 scoped_refptr<DelegatedFrameProvider> frame_provider_;
240 scoped_refptr<DelegatedRendererLayer> delegated_layer_; 241 scoped_refptr<DelegatedRendererLayer> delegated_layer_;
241 }; 242 };
242 243
243 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) { 244 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) {
244 RunTest(); 245 RunTest();
245 } 246 }
246 247
247 } // namespace 248 } // namespace
248 } // namespace cc 249 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_host_unittest_occlusion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698