OLD | NEW |
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 Loading... |
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()); | 257 root_->SetTransformOrigin(gfx::Point3F()); |
258 root_->SetBounds(gfx::Size(15, 15)); | 258 root_->SetBounds(gfx::Size(15, 15)); |
259 | 259 |
260 layer_tree_host()->SetRootLayer(root_); | 260 layer_tree_host()->SetRootLayer(root_); |
261 LayerTreeHostDelegatedTest::SetupTree(); | 261 LayerTreeHostDelegatedTest::SetupTree(); |
262 } | 262 } |
263 | 263 |
264 virtual void BeginTest() OVERRIDE { | 264 virtual void BeginTest() OVERRIDE { |
265 resource_collection_->SetClient(this); | 265 resource_collection_->SetClient(this); |
266 PostSetNeedsCommitToMainThread(); | 266 PostSetNeedsCommitToMainThread(); |
267 } | 267 } |
(...skipping 16 matching lines...) Expand all Loading... |
284 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(), | 284 frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(), |
285 frame_data.Pass()); | 285 frame_data.Pass()); |
286 | 286 |
287 delegated_ = CreateDelegatedLayer(frame_provider_.get()); | 287 delegated_ = CreateDelegatedLayer(frame_provider_.get()); |
288 } | 288 } |
289 | 289 |
290 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer( | 290 scoped_refptr<DelegatedRendererLayer> CreateDelegatedLayer( |
291 DelegatedFrameProvider* frame_provider) { | 291 DelegatedFrameProvider* frame_provider) { |
292 scoped_refptr<DelegatedRendererLayer> delegated = | 292 scoped_refptr<DelegatedRendererLayer> delegated = |
293 FakeDelegatedRendererLayer::Create(frame_provider); | 293 FakeDelegatedRendererLayer::Create(frame_provider); |
294 delegated->SetAnchorPoint(gfx::PointF()); | 294 delegated->SetTransformOrigin(gfx::Point3F()); |
295 delegated->SetBounds(gfx::Size(10, 10)); | 295 delegated->SetBounds(gfx::Size(10, 10)); |
296 delegated->SetIsDrawable(true); | 296 delegated->SetIsDrawable(true); |
297 | 297 |
298 root_->AddChild(delegated); | 298 root_->AddChild(delegated); |
299 return delegated; | 299 return delegated; |
300 } | 300 } |
301 | 301 |
302 virtual void AfterTest() OVERRIDE { resource_collection_->SetClient(NULL); } | 302 virtual void AfterTest() OVERRIDE { resource_collection_->SetClient(NULL); } |
303 | 303 |
304 // DelegatedFrameProviderClient implementation. | 304 // DelegatedFrameProviderClient implementation. |
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 } | 2195 } |
2196 | 2196 |
2197 scoped_refptr<DelegatedRendererLayer> delegated_thief_; | 2197 scoped_refptr<DelegatedRendererLayer> delegated_thief_; |
2198 }; | 2198 }; |
2199 | 2199 |
2200 SINGLE_AND_MULTI_THREAD_TEST_F( | 2200 SINGLE_AND_MULTI_THREAD_TEST_F( |
2201 LayerTreeHostDelegatedTestRemoveAndChangeResources); | 2201 LayerTreeHostDelegatedTestRemoveAndChangeResources); |
2202 | 2202 |
2203 } // namespace | 2203 } // namespace |
2204 } // namespace cc | 2204 } // namespace cc |
OLD | NEW |