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