| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/tree_synchronizer.h" | 5 #include "cc/tree_synchronizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
| 10 #include "cc/layer_animation_controller.h" | 10 #include "cc/layer_animation_controller.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 replicaLayerWithMask->SetMaskLayer(0); | 377 replicaLayerWithMask->SetMaskLayer(0); |
| 378 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(),
layerImplTreeRoot.Pass(), m_hostImpl.activeTree()); | 378 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(),
layerImplTreeRoot.Pass(), m_hostImpl.activeTree()); |
| 379 expectTreesAreIdentical(layerTreeRoot.get(), layerImplTreeRoot.get(), m_host
Impl.activeTree()); | 379 expectTreesAreIdentical(layerTreeRoot.get(), layerImplTreeRoot.get(), m_host
Impl.activeTree()); |
| 380 } | 380 } |
| 381 | 381 |
| 382 TEST_F(TreeSynchronizerTest, synchronizeAnimations) | 382 TEST_F(TreeSynchronizerTest, synchronizeAnimations) |
| 383 { | 383 { |
| 384 LayerTreeSettings settings; | 384 LayerTreeSettings settings; |
| 385 FakeProxy proxy(scoped_ptr<Thread>(NULL)); | 385 FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
| 386 DebugScopedSetImplThread impl(&proxy); | 386 DebugScopedSetImplThread impl(&proxy); |
| 387 scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings,
0, &proxy); | 387 scoped_ptr<RenderingStatsRecorder> renderingStatsRecorder = RenderingStatsRe
corder::create(); |
| 388 scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings,
0, &proxy, renderingStatsRecorder.get()); |
| 388 | 389 |
| 389 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); | 390 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); |
| 390 | 391 |
| 391 layerTreeRoot->SetLayerAnimationController(FakeLayerAnimationController::Cre
ate()); | 392 layerTreeRoot->SetLayerAnimationController(FakeLayerAnimationController::Cre
ate()); |
| 392 | 393 |
| 393 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layer
_animation_controller())->synchronizedAnimations()); | 394 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layer
_animation_controller())->synchronizedAnimations()); |
| 394 | 395 |
| 395 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees
(layerTreeRoot.get(), scoped_ptr<LayerImpl>(), m_hostImpl.activeTree()); | 396 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees
(layerTreeRoot.get(), scoped_ptr<LayerImpl>(), m_hostImpl.activeTree()); |
| 396 TreeSynchronizer::pushProperties(layerTreeRoot.get(), layerImplTreeRoot.get(
)); | 397 TreeSynchronizer::pushProperties(layerTreeRoot.get(), layerImplTreeRoot.get(
)); |
| 397 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(),
layerImplTreeRoot.Pass(), m_hostImpl.activeTree()); | 398 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(),
layerImplTreeRoot.Pass(), m_hostImpl.activeTree()); |
| 398 | 399 |
| 399 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layer_
animation_controller())->synchronizedAnimations()); | 400 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layer_
animation_controller())->synchronizedAnimations()); |
| 400 } | 401 } |
| 401 | 402 |
| 402 } // namespace | 403 } // namespace |
| 403 } // namespace cc | 404 } // namespace cc |
| OLD | NEW |