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

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

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 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 | Annotate | Revision Log
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 public DelegatedFrameResourceCollectionClient { 247 public DelegatedFrameResourceCollectionClient {
248 public: 248 public:
249 LayerTreeHostDelegatedTestCaseSingleDelegatedLayer() 249 LayerTreeHostDelegatedTestCaseSingleDelegatedLayer()
250 : resource_collection_(new DelegatedFrameResourceCollection), 250 : resource_collection_(new DelegatedFrameResourceCollection),
251 available_(false) { 251 available_(false) {
252 resource_collection_->SetClient(this); 252 resource_collection_->SetClient(this);
253 } 253 }
254 254
255 virtual void SetupTree() OVERRIDE { 255 virtual void SetupTree() OVERRIDE {
256 root_ = Layer::Create(); 256 root_ = Layer::Create();
257 root_->SetAnchorPoint(gfx::PointF());
258 root_->SetBounds(gfx::Size(15, 15)); 257 root_->SetBounds(gfx::Size(15, 15));
259 258
260 layer_tree_host()->SetRootLayer(root_); 259 layer_tree_host()->SetRootLayer(root_);
261 LayerTreeHostDelegatedTest::SetupTree(); 260 LayerTreeHostDelegatedTest::SetupTree();
262 } 261 }
263 262
264 virtual void BeginTest() OVERRIDE { 263 virtual void BeginTest() OVERRIDE {
265 resource_collection_->SetClient(this); 264 resource_collection_->SetClient(this);
266 PostSetNeedsCommitToMainThread(); 265 PostSetNeedsCommitToMainThread();
267 } 266 }
(...skipping 16 matching lines...) Expand all
284 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(), 283 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(),
285 frame_data.Pass()); 284 frame_data.Pass());
286 285
287 delegated_ = CreateDelegatedLayer(frame_provider_.get()); 286 delegated_ = CreateDelegatedLayer(frame_provider_.get());
288 } 287 }
289 288
290 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer( 289 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer(
291 DelegatedFrameProvider* frame_provider) { 290 DelegatedFrameProvider* frame_provider) {
292 scoped_refptr<DelegatedRendererLayer> delegated = 291 scoped_refptr<DelegatedRendererLayer> delegated =
293 FakeDelegatedRendererLayer::Create(frame_provider); 292 FakeDelegatedRendererLayer::Create(frame_provider);
294 delegated->SetAnchorPoint(gfx::PointF());
295 delegated->SetBounds(gfx::Size(10, 10)); 293 delegated->SetBounds(gfx::Size(10, 10));
296 delegated->SetIsDrawable(true); 294 delegated->SetIsDrawable(true);
297 295
298 root_->AddChild(delegated); 296 root_->AddChild(delegated);
299 return delegated; 297 return delegated;
300 } 298 }
301 299
302 virtual void AfterTest() OVERRIDE { resource_collection_->SetClient(NULL); } 300 virtual void AfterTest() OVERRIDE { resource_collection_->SetClient(NULL); }
303 301
304 // DelegatedFrameProviderClient implementation. 302 // DelegatedFrameProviderClient implementation.
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 } 2193 }
2196 2194
2197 scoped_refptr<DelegatedRendererLayer> delegated_thief_; 2195 scoped_refptr<DelegatedRendererLayer> delegated_thief_;
2198 }; 2196 };
2199 2197
2200 SINGLE_AND_MULTI_THREAD_TEST_F( 2198 SINGLE_AND_MULTI_THREAD_TEST_F(
2201 LayerTreeHostDelegatedTestRemoveAndChangeResources); 2199 LayerTreeHostDelegatedTestRemoveAndChangeResources);
2202 2200
2203 } // namespace 2201 } // namespace
2204 } // namespace cc 2202 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698