Index: cc/resources/tile_manager.cc |
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
index 4812df220b9d7c10345f71b5e5af080cbe8fdadf..dff3a52f871ac6a80cd05b77e92fc25ab6b14fed 100644 |
--- a/cc/resources/tile_manager.cc |
+++ b/cc/resources/tile_manager.cc |
@@ -364,7 +364,7 @@ |
TileVector tiles_that_need_to_be_rasterized; |
AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized, |
- scheduled_raster_task_limit_); |
+ scheduled_raster_task_limit_, false); |
// Schedule tile tasks. |
ScheduleTasks(tiles_that_need_to_be_rasterized); |
@@ -375,7 +375,7 @@ |
if (global_state_.hard_memory_limit_in_bytes == 0) { |
TileVector tiles_that_need_to_be_rasterized; |
AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized, |
- scheduled_raster_task_limit_); |
+ scheduled_raster_task_limit_, false); |
DCHECK(tiles_that_need_to_be_rasterized.empty()); |
} |
@@ -407,7 +407,7 @@ |
TileVector tiles_that_need_to_be_rasterized; |
AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized, |
- std::numeric_limits<size_t>::max()); |
+ std::numeric_limits<size_t>::max(), true); |
// We must reduce the amount of unused resources before calling |
// RunTasks to prevent usage from rising above limits. |
@@ -555,7 +555,8 @@ |
void TileManager::AssignGpuMemoryToTiles( |
TileVector* tiles_that_need_to_be_rasterized, |
- size_t scheduled_raster_task_limit) { |
+ size_t scheduled_raster_task_limit, |
+ bool required_for_draw_only) { |
TRACE_EVENT_BEGIN0("cc", "TileManager::AssignGpuMemoryToTiles"); |
// Maintain the list of released resources that can potentially be re-used |
@@ -584,6 +585,15 @@ |
while (!raster_priority_queue_.IsEmpty()) { |
Tile* tile = raster_priority_queue_.Top(); |
+ |
+ // TODO(vmpstr): Remove this when the iterator returns the correct tiles |
+ // to draw for GPU rasterization. |
+ if (required_for_draw_only) { |
+ if (!tile->required_for_draw()) { |
+ raster_priority_queue_.Pop(); |
+ continue; |
+ } |
+ } |
TilePriority priority = tile->combined_priority(); |
if (TilePriorityViolatesMemoryPolicy(priority)) { |
@@ -941,7 +951,7 @@ |
// where top-priority tiles are initialized. |
TileVector tiles_that_need_to_be_rasterized; |
AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized, |
- scheduled_raster_task_limit_); |
+ scheduled_raster_task_limit_, false); |
// |tiles_that_need_to_be_rasterized| will be empty when we reach a |
// steady memory state. Keep scheduling tasks until we reach this state. |