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

Side by Side Diff: cc/tree_synchronizer_unittest.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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
« no previous file with comments | « cc/tree_synchronizer.cc ('k') | cc/video_frame_provider_client_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 protected: 137 protected:
138 FakeImplProxy m_proxy; 138 FakeImplProxy m_proxy;
139 FakeLayerTreeHostImpl m_hostImpl; 139 FakeLayerTreeHostImpl m_hostImpl;
140 }; 140 };
141 141
142 // Attempts to synchronizes a null tree. This should not crash, and should 142 // Attempts to synchronizes a null tree. This should not crash, and should
143 // return a null tree. 143 // return a null tree.
144 TEST_F(TreeSynchronizerTest, syncNullTree) 144 TEST_F(TreeSynchronizerTest, syncNullTree)
145 { 145 {
146 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees (0, scoped_ptr<LayerImpl>(), m_hostImpl.activeTree()); 146 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees (static_cast<Layer*>(NULL), scoped_ptr<LayerImpl>(), m_hostImpl.activeTree());
147 147
148 EXPECT_TRUE(!layerImplTreeRoot.get()); 148 EXPECT_TRUE(!layerImplTreeRoot.get());
149 } 149 }
150 150
151 // Constructs a very simple tree and synchronizes it without trying to reuse any preexisting layers. 151 // Constructs a very simple tree and synchronizes it without trying to reuse any preexisting layers.
152 TEST_F(TreeSynchronizerTest, syncSimpleTreeFromEmpty) 152 TEST_F(TreeSynchronizerTest, syncSimpleTreeFromEmpty)
153 { 153 {
154 scoped_refptr<Layer> layerTreeRoot = Layer::create(); 154 scoped_refptr<Layer> layerTreeRoot = Layer::create();
155 layerTreeRoot->addChild(Layer::create()); 155 layerTreeRoot->addChild(Layer::create());
156 layerTreeRoot->addChild(Layer::create()); 156 layerTreeRoot->addChild(Layer::create());
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees (layerTreeRoot.get(), scoped_ptr<LayerImpl>(), m_hostImpl.activeTree()); 395 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees (layerTreeRoot.get(), scoped_ptr<LayerImpl>(), m_hostImpl.activeTree());
396 TreeSynchronizer::pushProperties(layerTreeRoot.get(), layerImplTreeRoot.get( )); 396 TreeSynchronizer::pushProperties(layerTreeRoot.get(), layerImplTreeRoot.get( ));
397 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), layerImplTreeRoot.Pass(), m_hostImpl.activeTree()); 397 layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), layerImplTreeRoot.Pass(), m_hostImpl.activeTree());
398 398
399 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerA nimationController())->synchronizedAnimations()); 399 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(layerTreeRoot->layerA nimationController())->synchronizedAnimations());
400 } 400 }
401 401
402 } // namespace 402 } // namespace
403 } // namespace cc 403 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tree_synchronizer.cc ('k') | cc/video_frame_provider_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698