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

Side by Side Diff: cc/trees/layer_tree_host_unittest_delegated.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 : public LayerTreeHostDelegatedTest, 265 : public LayerTreeHostDelegatedTest,
266 public DelegatedFrameResourceCollectionClient { 266 public DelegatedFrameResourceCollectionClient {
267 public: 267 public:
268 LayerTreeHostDelegatedTestCaseSingleDelegatedLayer() 268 LayerTreeHostDelegatedTestCaseSingleDelegatedLayer()
269 : resource_collection_(new DelegatedFrameResourceCollection), 269 : resource_collection_(new DelegatedFrameResourceCollection),
270 available_(false) { 270 available_(false) {
271 resource_collection_->SetClient(this); 271 resource_collection_->SetClient(this);
272 } 272 }
273 273
274 void SetupTree() override { 274 void SetupTree() override {
275 root_ = Layer::Create(); 275 root_ = Layer::Create(layer_settings());
276 root_->SetBounds(gfx::Size(15, 15)); 276 root_->SetBounds(gfx::Size(15, 15));
277 277
278 layer_tree_host()->SetRootLayer(root_); 278 layer_tree_host()->SetRootLayer(root_);
279 LayerTreeHostDelegatedTest::SetupTree(); 279 LayerTreeHostDelegatedTest::SetupTree();
280 } 280 }
281 281
282 void BeginTest() override { 282 void BeginTest() override {
283 resource_collection_->SetClient(this); 283 resource_collection_->SetClient(this);
284 PostSetNeedsCommitToMainThread(); 284 PostSetNeedsCommitToMainThread();
285 } 285 }
(...skipping 15 matching lines...) Expand all
301 301
302 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(), 302 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(),
303 frame_data.Pass()); 303 frame_data.Pass());
304 304
305 delegated_ = CreateDelegatedLayer(frame_provider_.get()); 305 delegated_ = CreateDelegatedLayer(frame_provider_.get());
306 } 306 }
307 307
308 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer( 308 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer(
309 DelegatedFrameProvider* frame_provider) { 309 DelegatedFrameProvider* frame_provider) {
310 scoped_refptr<DelegatedRendererLayer> delegated = 310 scoped_refptr<DelegatedRendererLayer> delegated =
311 FakeDelegatedRendererLayer::Create(frame_provider); 311 FakeDelegatedRendererLayer::Create(layer_settings(), frame_provider);
312 delegated->SetBounds(gfx::Size(10, 10)); 312 delegated->SetBounds(gfx::Size(10, 10));
313 delegated->SetIsDrawable(true); 313 delegated->SetIsDrawable(true);
314 314
315 root_->AddChild(delegated); 315 root_->AddChild(delegated);
316 return delegated; 316 return delegated;
317 } 317 }
318 318
319 void AfterTest() override { resource_collection_->SetClient(NULL); } 319 void AfterTest() override { resource_collection_->SetClient(NULL); }
320 320
321 // DelegatedFrameProviderClient implementation. 321 // DelegatedFrameProviderClient implementation.
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 ReturnAllResourcesFromParent(host_impl); 2283 ReturnAllResourcesFromParent(host_impl);
2284 } 2284 }
2285 2285
2286 bool drew_with_pending_tree_; 2286 bool drew_with_pending_tree_;
2287 }; 2287 };
2288 2288
2289 MULTI_THREAD_IMPL_TEST_F(LayerTreeHostDelegatedTestActiveFrameIsValid); 2289 MULTI_THREAD_IMPL_TEST_F(LayerTreeHostDelegatedTestActiveFrameIsValid);
2290 2290
2291 } // namespace 2291 } // namespace
2292 } // namespace cc 2292 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698