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

Unified Diff: cc/resources/tile_manager.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « cc/resources/tile_draw_info.cc ('k') | cc/resources/tile_manager_perftest.cc » ('j') | no next file with comments »
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 00ae3da6e92fed3b9a96a0d8e5b781df8541b4d8..94b6332a9aa4229bcfaa1b90831beba679a39416 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -439,11 +439,11 @@ void TileManager::SynchronouslyRasterizeTiles(
global_state_.tree_priority,
RasterTilePriorityQueue::Type::REQUIRED_FOR_DRAW);
- // Change to OOM mode for any tiles that have not been been assigned memory.
- // This ensures that we draw even when OOM.
+ // Use on-demand raster for any tiles that have not been been assigned
+ // memory. This ensures that we draw even when OOM.
for (; !required_for_draw_queue->IsEmpty(); required_for_draw_queue->Pop()) {
Tile* tile = required_for_draw_queue->Top();
- tile->draw_info().set_oom();
+ tile->draw_info().set_rasterize_on_demand();
client_->NotifyTileStateChanged(tile);
}
@@ -604,8 +604,8 @@ void TileManager::AssignGpuMemoryToTiles(
TileDrawInfo& draw_info = tile->draw_info();
tile->scheduled_priority_ = schedule_priority++;
- DCHECK_IMPLIES(draw_info.mode() != TileDrawInfo::OOM_MODE,
- !draw_info.IsReadyToDraw());
+ DCHECK(draw_info.mode() == TileDrawInfo::PICTURE_PILE_MODE ||
+ !draw_info.IsReadyToDraw());
// If the tile already has a raster_task, then the memory used by it is
// already accounted for in memory_usage. Otherwise, we'll have to acquire
@@ -973,30 +973,31 @@ void TileManager::CheckIfMoreTilesNeedToBePrepared() {
// Likewise if we don't allow any tiles (as is the case when we're
// invisible), if we have tiles that aren't ready, then we shouldn't
// activate as activation can cause checkerboards.
- bool wait_for_all_required_tiles =
- global_state_.tree_priority == SMOOTHNESS_TAKES_PRIORITY ||
- global_state_.memory_limit_policy == ALLOW_NOTHING;
-
- // Mark any required-for-activation tiles that have not been been assigned
- // memory after reaching a steady memory state as OOM. This ensures that we
- // activate even when OOM. Note that we can't reuse the queue we used for
- // AssignGpuMemoryToTiles, since the AssignGpuMemoryToTiles call could have
- // evicted some tiles that would not be picked up by the old raster queue.
+ bool allow_rasterize_on_demand =
+ global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY &&
+ global_state_.memory_limit_policy != ALLOW_NOTHING;
+
+ // 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. Note that we can't reuse the queue
+ // we used for AssignGpuMemoryToTiles, since the AssignGpuMemoryToTiles call
+ // could have evicted some tiles that would not be picked up by the old raster
+ // queue.
scoped_ptr<RasterTilePriorityQueue> required_for_activation_queue(
client_->BuildRasterQueue(
global_state_.tree_priority,
RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION));
- // If we have tiles left to raster for activation, and we don't allow
- // activating without them, then skip activation and return early.
- if (!required_for_activation_queue->IsEmpty() && wait_for_all_required_tiles)
+ // If we have tiles to mark as rasterize on demand, but we don't allow
+ // rasterize on demand, then skip activation and return early.
+ if (!required_for_activation_queue->IsEmpty() && !allow_rasterize_on_demand)
return;
- // Mark required tiles as OOM so that we can activate without them.
+ // Mark required tiles as rasterize on demand.
for (; !required_for_activation_queue->IsEmpty();
required_for_activation_queue->Pop()) {
Tile* tile = required_for_activation_queue->Top();
- tile->draw_info().set_oom();
+ tile->draw_info().set_rasterize_on_demand();
client_->NotifyTileStateChanged(tile);
}
« no previous file with comments | « cc/resources/tile_draw_info.cc ('k') | cc/resources/tile_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698