| 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()); | |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |