Chromium Code Reviews| Index: cc/resources/tile_manager.cc |
| diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
| index 3e91167866031a18cb3c342f37f4f1fa4c9d3c1b..465dfc3a459c0ccca183d30ce11a85c435e53929 100644 |
| --- a/cc/resources/tile_manager.cc |
| +++ b/cc/resources/tile_manager.cc |
| @@ -241,6 +241,13 @@ void TileManager::DidFinishRunningTasks() { |
| return; |
| } |
| + // We don't reserve memory for required-for-activate tiles during smoothness |
| + // mode, so it is very likely these tiles will not get memory. So we prevent |
| + // raster-on-demand and simply don't activate in this case. |
| + bool allow_rasterize_on_demand = global_state_.tree_priority |
| + != SMOOTHNESS_TAKES_PRIORITY; |
| + bool can_activate = true; |
|
reveman
2013/09/03 19:03:21
can you drop this and just early out below when yo
epenner
2013/09/03 19:36:29
Good one! Done.
|
| + |
| // Use on-demand raster for any required-for-activation tiles that have not |
| // been been assigned memory after reaching a steady memory state. This |
| // ensures that we activate even when OOM. |
| @@ -250,11 +257,16 @@ void TileManager::DidFinishRunningTasks() { |
| ManagedTileState::TileVersion& tile_version = |
| mts.tile_versions[mts.raster_mode]; |
| - if (tile->required_for_activation() && !tile_version.IsReadyToDraw()) |
| - tile_version.set_rasterize_on_demand(); |
| + if (tile->required_for_activation() && !tile_version.IsReadyToDraw()) { |
| + if (allow_rasterize_on_demand) |
| + tile_version.set_rasterize_on_demand(); |
| + else |
| + can_activate = false; |
| + } |
| } |
| - client_->NotifyReadyToActivate(); |
| + if (can_activate) |
| + client_->NotifyReadyToActivate(); |
| } |
| void TileManager::DidFinishRunningTasksRequiredForActivation() { |