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

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11573069: [cc] Fold more update calls into updateDrawProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/layer_tree_host_impl_unittest.cc ('k') | cc/test/fake_layer_tree_host_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/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/synchronization/lock.h" 7 #include "base/synchronization/lock.h"
8 #include "cc/content_layer.h" 8 #include "cc/content_layer.h"
9 #include "cc/content_layer_client.h" 9 #include "cc/content_layer_client.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize()); 1358 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize());
1359 1359
1360 LayerImpl* root = impl->rootLayer(); 1360 LayerImpl* root = impl->rootLayer();
1361 LayerImpl* child = impl->rootLayer()->children()[0]; 1361 LayerImpl* child = impl->rootLayer()->children()[0];
1362 1362
1363 // Positions remain in layout pixels. 1363 // Positions remain in layout pixels.
1364 EXPECT_EQ(gfx::Point(0, 0), root->position()); 1364 EXPECT_EQ(gfx::Point(0, 0), root->position());
1365 EXPECT_EQ(gfx::Point(2, 2), child->position()); 1365 EXPECT_EQ(gfx::Point(2, 2), child->position());
1366 1366
1367 // Compute all the layer transforms for the frame. 1367 // Compute all the layer transforms for the frame.
1368 MockLayerTreeHostImpl::LayerList renderSurfaceLayerList; 1368 LayerTreeHostImpl::FrameData frameData;
1369 mockImpl->calculateRenderSurfaceLayerList(renderSurfaceLayerList); 1369 mockImpl->prepareToDraw(frameData);
1370 mockImpl->didDrawAllLayers(frameData);
1371
1372 const MockLayerTreeHostImpl::LayerList& renderSurfaceLayerList =
1373 *frameData.renderSurfaceLayerList;
1370 1374
1371 // Both layers should be drawing into the root render surface. 1375 // Both layers should be drawing into the root render surface.
1372 ASSERT_EQ(1u, renderSurfaceLayerList.size()); 1376 ASSERT_EQ(1u, renderSurfaceLayerList.size());
1373 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac e()); 1377 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac e());
1374 ASSERT_EQ(2u, root->renderSurface()->layerList().size()); 1378 ASSERT_EQ(2u, root->renderSurface()->layerList().size());
1375 1379
1376 // The root render surface is the size of the viewport. 1380 // The root render surface is the size of the viewport.
1377 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe ct()); 1381 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe ct());
1378 1382
1379 // The content bounds of the child should be scaled. 1383 // The content bounds of the child should be scaled.
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 LayerTreeSettings settings; 3417 LayerTreeSettings settings;
3414 settings.maxPartialTextureUpdates = 4; 3418 settings.maxPartialTextureUpdates = 4;
3415 3419
3416 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); 3420 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>());
3417 EXPECT_TRUE(host->initializeRendererIfNeeded()); 3421 EXPECT_TRUE(host->initializeRendererIfNeeded());
3418 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); 3422 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates);
3419 } 3423 }
3420 3424
3421 } // namespace 3425 } // namespace
3422 } // namespace cc 3426 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl_unittest.cc ('k') | cc/test/fake_layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698