OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 EXPECT_FALSE(some_active_tile->IsReadyToDraw()); | 1291 EXPECT_FALSE(some_active_tile->IsReadyToDraw()); |
1292 | 1292 |
1293 // When high res are required, even if the active tree is not ready, | 1293 // When high res are required, even if the active tree is not ready, |
1294 // the high res tiles must be ready. | 1294 // the high res tiles must be ready. |
1295 host_impl_.active_tree()->SetRequiresHighResToDraw(); | 1295 host_impl_.active_tree()->SetRequiresHighResToDraw(); |
1296 pending_layer_->MarkVisibleResourcesAsRequired(); | 1296 pending_layer_->MarkVisibleResourcesAsRequired(); |
1297 AssertAllTilesRequired(pending_layer_->HighResTiling()); | 1297 AssertAllTilesRequired(pending_layer_->HighResTiling()); |
1298 AssertNoTilesRequired(pending_layer_->LowResTiling()); | 1298 AssertNoTilesRequired(pending_layer_->LowResTiling()); |
1299 } | 1299 } |
1300 | 1300 |
1301 // TODO(enne): temporarily disabled: http://crbug.com/335289 | 1301 TEST_F(PictureLayerImplTest, NothingRequiredIfAllHighResTilesShared) { |
1302 TEST_F(PictureLayerImplTest, DISABLED_NothingRequiredIfAllHighResTilesShared) { | |
1303 gfx::Size layer_bounds(400, 400); | 1302 gfx::Size layer_bounds(400, 400); |
1304 gfx::Size tile_size(100, 100); | 1303 gfx::Size tile_size(100, 100); |
1305 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size); | 1304 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size); |
1306 | 1305 |
1307 CreateHighLowResAndSetAllTilesVisible(); | 1306 CreateHighLowResAndSetAllTilesVisible(); |
1308 | 1307 |
1309 Tile* some_active_tile = | 1308 Tile* some_active_tile = |
1310 active_layer_->HighResTiling()->AllTilesForTesting()[0]; | 1309 active_layer_->HighResTiling()->AllTilesForTesting()[0]; |
1311 EXPECT_FALSE(some_active_tile->IsReadyToDraw()); | 1310 EXPECT_FALSE(some_active_tile->IsReadyToDraw()); |
1312 | 1311 |
1313 // All tiles shared (no invalidation), so even though the active tree's | 1312 // All tiles shared (no invalidation), so even though the active tree's |
1314 // tiles aren't ready, there is nothing required. | 1313 // tiles aren't ready, there is nothing required. |
1315 pending_layer_->MarkVisibleResourcesAsRequired(); | 1314 pending_layer_->MarkVisibleResourcesAsRequired(); |
1316 AssertNoTilesRequired(pending_layer_->HighResTiling()); | 1315 AssertNoTilesRequired(pending_layer_->HighResTiling()); |
1317 AssertNoTilesRequired(pending_layer_->LowResTiling()); | 1316 AssertNoTilesRequired(pending_layer_->LowResTiling()); |
1318 } | 1317 } |
1319 | 1318 |
1320 // TODO(enne): temporarily disabled: http://crbug.com/335289 | 1319 TEST_F(PictureLayerImplTest, NothingRequiredIfActiveMissingTiles) { |
1321 TEST_F(PictureLayerImplTest, DISABLED_NothingRequiredIfActiveMissingTiles) { | |
1322 gfx::Size layer_bounds(400, 400); | 1320 gfx::Size layer_bounds(400, 400); |
1323 gfx::Size tile_size(100, 100); | 1321 gfx::Size tile_size(100, 100); |
1324 scoped_refptr<FakePicturePileImpl> pending_pile = | 1322 scoped_refptr<FakePicturePileImpl> pending_pile = |
1325 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 1323 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
1326 // An arbitrary bogus outside the layer recording. Enough for the layer to | 1324 // An arbitrary bogus outside the layer recording. Enough for the layer to |
1327 // think it can create tiles, but not in bounds so all tiles are null. | 1325 // think it can create tiles, but not in bounds so all tiles are null. |
1328 Region active_recorded_region; | 1326 Region active_recorded_region; |
1329 active_recorded_region.Union(gfx::Rect(1000, 1000, 1, 1)); | 1327 active_recorded_region.Union(gfx::Rect(1000, 1000, 1, 1)); |
1330 scoped_refptr<FakePicturePileImpl> active_pile = | 1328 scoped_refptr<FakePicturePileImpl> active_pile = |
1331 FakePicturePileImpl::CreatePileWithRecordedRegion( | 1329 FakePicturePileImpl::CreatePileWithRecordedRegion( |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 TestContextProvider::Create(), NULL)); | 1557 TestContextProvider::Create(), NULL)); |
1560 | 1558 |
1561 // These will crash PictureLayerImpl if this is not true. | 1559 // These will crash PictureLayerImpl if this is not true. |
1562 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); | 1560 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); |
1563 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); | 1561 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); |
1564 host_impl_.active_tree()->UpdateDrawProperties(); | 1562 host_impl_.active_tree()->UpdateDrawProperties(); |
1565 } | 1563 } |
1566 | 1564 |
1567 } // namespace | 1565 } // namespace |
1568 } // namespace cc | 1566 } // namespace cc |
OLD | NEW |