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

Side by Side Diff: cc/tree_synchronizer_unittest.cc

Issue 12519006: cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Early out in methods, pass raw pointers, updated tests Created 7 years, 9 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 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
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
OLDNEW
« cc/rendering_stats_recorder.cc ('K') | « cc/tile_manager.cc ('k') | cc/worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698