| 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/resources/eviction_tile_priority_queue.h" | 5 #include "cc/resources/eviction_tile_priority_queue.h" |
| 6 #include "cc/resources/raster_tile_priority_queue.h" | 6 #include "cc/resources/raster_tile_priority_queue.h" |
| 7 #include "cc/resources/resource_pool.h" | 7 #include "cc/resources/resource_pool.h" |
| 8 #include "cc/resources/tile.h" | 8 #include "cc/resources/tile.h" |
| 9 #include "cc/resources/tile_priority.h" | 9 #include "cc/resources/tile_priority.h" |
| 10 #include "cc/resources/tiling_set_raster_queue_all.h" | 10 #include "cc/resources/tiling_set_raster_queue_all.h" |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 scoped_ptr<ScopedResource> resource = | 1346 scoped_ptr<ScopedResource> resource = |
| 1347 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256), | 1347 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256), |
| 1348 RGBA_8888); | 1348 RGBA_8888); |
| 1349 | 1349 |
| 1350 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); | 1350 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); |
| 1351 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); | 1351 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); |
| 1352 | 1352 |
| 1353 host_impl_.resource_pool()->ReleaseResource(resource.Pass()); | 1353 host_impl_.resource_pool()->ReleaseResource(resource.Pass()); |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 TEST_F(TileManagerTilePriorityQueueTest, | |
| 1357 SetIsLikelyToRequireADrawOnSynchronousRaster) { | |
| 1358 const gfx::Size layer_bounds(1000, 1000); | |
| 1359 host_impl_.SetViewportSize(layer_bounds); | |
| 1360 host_impl_.SetUseGpuRasterization(true); | |
| 1361 EXPECT_EQ(host_impl_.rasterizer()->GetPrepareTilesMode(), | |
| 1362 PrepareTilesMode::PREPARE_NONE); | |
| 1363 SetupDefaultTrees(layer_bounds); | |
| 1364 | |
| 1365 // Verify that the queue has a required for draw tile at Top. | |
| 1366 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( | |
| 1367 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); | |
| 1368 EXPECT_FALSE(queue->IsEmpty()); | |
| 1369 EXPECT_TRUE(queue->Top()->required_for_draw()); | |
| 1370 | |
| 1371 host_impl_.SetIsLikelyToRequireADraw(true); | |
| 1372 | |
| 1373 EXPECT_TRUE(host_impl_.is_likely_to_require_a_draw()); | |
| 1374 host_impl_.tile_manager()->UpdateVisibleTiles(host_impl_.global_tile_state()); | |
| 1375 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); | |
| 1376 } | |
| 1377 | |
| 1378 } // namespace | 1356 } // namespace |
| 1379 } // namespace cc | 1357 } // namespace cc |
| OLD | NEW |