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

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11596005: Revert 173406 - Crashes on Win & Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize()); 1332 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize());
1333 1333
1334 LayerImpl* root = impl->rootLayer(); 1334 LayerImpl* root = impl->rootLayer();
1335 LayerImpl* child = impl->rootLayer()->children()[0]; 1335 LayerImpl* child = impl->rootLayer()->children()[0];
1336 1336
1337 // Positions remain in layout pixels. 1337 // Positions remain in layout pixels.
1338 EXPECT_EQ(gfx::Point(0, 0), root->position()); 1338 EXPECT_EQ(gfx::Point(0, 0), root->position());
1339 EXPECT_EQ(gfx::Point(2, 2), child->position()); 1339 EXPECT_EQ(gfx::Point(2, 2), child->position());
1340 1340
1341 // Compute all the layer transforms for the frame. 1341 // Compute all the layer transforms for the frame.
1342 LayerTreeHostImpl::FrameData frameData; 1342 MockLayerTreeHostImpl::LayerList renderSurfaceLayerList;
1343 mockImpl->prepareToDraw(frameData); 1343 mockImpl->calculateRenderSurfaceLayerList(renderSurfaceLayerList);
1344 mockImpl->didDrawAllLayers(frameData);
1345
1346 const MockLayerTreeHostImpl::LayerList& renderSurfaceLayerList =
1347 *frameData.renderSurfaceLayerList;
1348 1344
1349 // Both layers should be drawing into the root render surface. 1345 // Both layers should be drawing into the root render surface.
1350 ASSERT_EQ(1u, renderSurfaceLayerList.size()); 1346 ASSERT_EQ(1u, renderSurfaceLayerList.size());
1351 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac e()); 1347 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac e());
1352 ASSERT_EQ(2u, root->renderSurface()->layerList().size()); 1348 ASSERT_EQ(2u, root->renderSurface()->layerList().size());
1353 1349
1354 // The root render surface is the size of the viewport. 1350 // The root render surface is the size of the viewport.
1355 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe ct()); 1351 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe ct());
1356 1352
1357 // The content bounds of the child should be scaled. 1353 // The content bounds of the child should be scaled.
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 LayerTreeSettings settings; 3395 LayerTreeSettings settings;
3400 settings.maxPartialTextureUpdates = 4; 3396 settings.maxPartialTextureUpdates = 4;
3401 3397
3402 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); 3398 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>());
3403 EXPECT_TRUE(host->initializeRendererIfNeeded()); 3399 EXPECT_TRUE(host->initializeRendererIfNeeded());
3404 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); 3400 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates);
3405 } 3401 }
3406 3402
3407 } // namespace 3403 } // namespace
3408 } // namespace cc 3404 } // 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