OLD | NEW |
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 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize()); | 1322 EXPECT_EQ(gfx::Size(60, 60), impl->deviceViewportSize()); |
1323 | 1323 |
1324 LayerImpl* root = impl->rootLayer(); | 1324 LayerImpl* root = impl->rootLayer(); |
1325 LayerImpl* child = impl->rootLayer()->children()[0]; | 1325 LayerImpl* child = impl->rootLayer()->children()[0]; |
1326 | 1326 |
1327 // Positions remain in layout pixels. | 1327 // Positions remain in layout pixels. |
1328 EXPECT_EQ(gfx::Point(0, 0), root->position()); | 1328 EXPECT_EQ(gfx::Point(0, 0), root->position()); |
1329 EXPECT_EQ(gfx::Point(2, 2), child->position()); | 1329 EXPECT_EQ(gfx::Point(2, 2), child->position()); |
1330 | 1330 |
1331 // Compute all the layer transforms for the frame. | 1331 // Compute all the layer transforms for the frame. |
1332 MockLayerTreeHostImpl::LayerList renderSurfaceLayerList; | 1332 LayerTreeHostImpl::FrameData frameData; |
1333 mockImpl->calculateRenderSurfaceLayerList(renderSurfaceLayerList); | 1333 mockImpl->prepareToDraw(frameData); |
| 1334 mockImpl->didDrawAllLayers(frameData); |
| 1335 |
| 1336 const MockLayerTreeHostImpl::LayerList& renderSurfaceLayerList = |
| 1337 *frameData.renderSurfaceLayerList; |
1334 | 1338 |
1335 // Both layers should be drawing into the root render surface. | 1339 // Both layers should be drawing into the root render surface. |
1336 ASSERT_EQ(1u, renderSurfaceLayerList.size()); | 1340 ASSERT_EQ(1u, renderSurfaceLayerList.size()); |
1337 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac
e()); | 1341 ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurfac
e()); |
1338 ASSERT_EQ(2u, root->renderSurface()->layerList().size()); | 1342 ASSERT_EQ(2u, root->renderSurface()->layerList().size()); |
1339 | 1343 |
1340 // The root render surface is the size of the viewport. | 1344 // The root render surface is the size of the viewport. |
1341 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe
ct()); | 1345 EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), root->renderSurface()->contentRe
ct()); |
1342 | 1346 |
1343 // The content bounds of the child should be scaled. | 1347 // The content bounds of the child should be scaled. |
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 LayerTreeSettings settings; | 3383 LayerTreeSettings settings; |
3380 settings.maxPartialTextureUpdates = 4; | 3384 settings.maxPartialTextureUpdates = 4; |
3381 | 3385 |
3382 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); | 3386 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); |
3383 EXPECT_TRUE(host->initializeRendererIfNeeded()); | 3387 EXPECT_TRUE(host->initializeRendererIfNeeded()); |
3384 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); | 3388 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); |
3385 } | 3389 } |
3386 | 3390 |
3387 } // namespace | 3391 } // namespace |
3388 } // namespace cc | 3392 } // namespace cc |
OLD | NEW |