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

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11573019: cc: Fix a number of tests that need content bounds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only touch one file 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 | « no previous file | no next file » | 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 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 m_rootLayer->setIsDrawable(true); 1303 m_rootLayer->setIsDrawable(true);
1304 m_rootLayer->setBounds(gfx::Size(30, 30)); 1304 m_rootLayer->setBounds(gfx::Size(30, 30));
1305 m_rootLayer->setAnchorPoint(gfx::PointF(0, 0)); 1305 m_rootLayer->setAnchorPoint(gfx::PointF(0, 0));
1306 1306
1307 m_childLayer->setIsDrawable(true); 1307 m_childLayer->setIsDrawable(true);
1308 m_childLayer->setPosition(gfx::Point(2, 2)); 1308 m_childLayer->setPosition(gfx::Point(2, 2));
1309 m_childLayer->setBounds(gfx::Size(10, 10)); 1309 m_childLayer->setBounds(gfx::Size(10, 10));
1310 m_childLayer->setAnchorPoint(gfx::PointF(0, 0)); 1310 m_childLayer->setAnchorPoint(gfx::PointF(0, 0));
1311 1311
1312 m_layerTreeHost->setRootLayer(m_rootLayer); 1312 m_layerTreeHost->setRootLayer(m_rootLayer);
1313
1314 ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
1315 ResourceUpdateQueue queue;
1316 m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()) ;
1313 postSetNeedsCommitToMainThread(); 1317 postSetNeedsCommitToMainThread();
1314 } 1318 }
1315 1319
1316 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE 1320 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE
1317 { 1321 {
1318 // Get access to protected methods. 1322 // Get access to protected methods.
1319 MockLayerTreeHostImpl* mockImpl = static_cast<MockLayerTreeHostImpl*>(im pl); 1323 MockLayerTreeHostImpl* mockImpl = static_cast<MockLayerTreeHostImpl*>(im pl);
1320 1324
1321 // Should only do one commit. 1325 // Should only do one commit.
1322 EXPECT_EQ(0, impl->activeTree()->source_frame_number()); 1326 EXPECT_EQ(0, impl->activeTree()->source_frame_number());
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 { 1404 {
1401 // Make sure partial texture updates are turned off. 1405 // Make sure partial texture updates are turned off.
1402 m_settings.maxPartialTextureUpdates = 0; 1406 m_settings.maxPartialTextureUpdates = 0;
1403 } 1407 }
1404 1408
1405 virtual void beginTest() OVERRIDE 1409 virtual void beginTest() OVERRIDE
1406 { 1410 {
1407 m_layerTreeHost->setRootLayer(m_layer); 1411 m_layerTreeHost->setRootLayer(m_layer);
1408 m_layerTreeHost->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); 1412 m_layerTreeHost->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
1409 1413
1414 ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
1415 ResourceUpdateQueue queue;
1416 m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()) ;
1410 postSetNeedsCommitToMainThread(); 1417 postSetNeedsCommitToMainThread();
1411 postSetNeedsRedrawToMainThread(); 1418 postSetNeedsRedrawToMainThread();
1412 } 1419 }
1413 1420
1414 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE 1421 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE
1415 { 1422 {
1416 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_ cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->outputSurface ()->Context3D()); 1423 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_ cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->outputSurface ()->Context3D());
1417 1424
1418 switch (impl->activeTree()->source_frame_number()) { 1425 switch (impl->activeTree()->source_frame_number()) {
1419 case 0: 1426 case 0:
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 1511
1505 virtual void beginTest() OVERRIDE 1512 virtual void beginTest() OVERRIDE
1506 { 1513 {
1507 m_layerTreeHost->setRootLayer(m_parent); 1514 m_layerTreeHost->setRootLayer(m_parent);
1508 m_layerTreeHost->setViewportSize(gfx::Size(10, 20), gfx::Size(10, 20)); 1515 m_layerTreeHost->setViewportSize(gfx::Size(10, 20), gfx::Size(10, 20));
1509 1516
1510 gfx::Transform identityMatrix; 1517 gfx::Transform identityMatrix;
1511 setLayerPropertiesForTesting(m_parent.get(), 0, identityMatrix, gfx::Poi ntF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 20), true); 1518 setLayerPropertiesForTesting(m_parent.get(), 0, identityMatrix, gfx::Poi ntF(0, 0), gfx::PointF(0, 0), gfx::Size(10, 20), true);
1512 setLayerPropertiesForTesting(m_child.get(), m_parent.get(), identityMatr ix, gfx::PointF(0, 0), gfx::PointF(0, 10), gfx::Size(10, 10), false); 1519 setLayerPropertiesForTesting(m_child.get(), m_parent.get(), identityMatr ix, gfx::PointF(0, 0), gfx::PointF(0, 10), gfx::Size(10, 10), false);
1513 1520
1521 ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
1522 ResourceUpdateQueue queue;
1523 m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()) ;
1514 postSetNeedsCommitToMainThread(); 1524 postSetNeedsCommitToMainThread();
1515 postSetNeedsRedrawToMainThread(); 1525 postSetNeedsRedrawToMainThread();
1516 } 1526 }
1517 1527
1518 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE 1528 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE
1519 { 1529 {
1520 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_ cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->outputSurface ()->Context3D()); 1530 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_ cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->outputSurface ()->Context3D());
1521 1531
1522 switch (impl->activeTree()->source_frame_number()) { 1532 switch (impl->activeTree()->source_frame_number()) {
1523 case 0: 1533 case 0:
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
3388 LayerTreeSettings settings; 3398 LayerTreeSettings settings;
3389 settings.maxPartialTextureUpdates = 4; 3399 settings.maxPartialTextureUpdates = 4;
3390 3400
3391 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); 3401 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>());
3392 EXPECT_TRUE(host->initializeRendererIfNeeded()); 3402 EXPECT_TRUE(host->initializeRendererIfNeeded());
3393 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); 3403 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates);
3394 } 3404 }
3395 3405
3396 } // namespace 3406 } // namespace
3397 } // namespace cc 3407 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698