Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: cc/resources/tile_manager.cc

Issue 23495022: CC: Add a scheduled action for ManageTiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698