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

Unified Diff: cc/resources/tile_manager.cc

Issue 1035043002: cc: Fix memory limit edge cases for SetIsLikelyToRequireADraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 9 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_manager.h ('k') | cc/resources/tile_manager_unittest.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 71f2e83017547d2aa9131b37c619bf8bee749041..928861796487b0f4aac00f92bb918ff39316dfa3 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -426,6 +426,11 @@ void TileManager::SynchronouslyRasterizeTiles(
std::numeric_limits<size_t>::max(),
&tiles_that_need_to_be_rasterized);
+ // Since we are synchronously rasterizing all tiles, we don't require further
+ // draws for that. Set the flag to false so that we can clear it if it was set
+ // earlier by PrepareTiles.
+ client_->SetIsLikelyToRequireADraw(false);
+
// We must reduce the amount of unused resources before calling
// RunTasks to prevent usage from rising above limits.
resource_pool_->ReduceResourceUsage();
@@ -961,6 +966,12 @@ void TileManager::CheckIfMoreTilesNeedToBePrepared() {
scheduled_raster_task_limit_,
&tiles_that_need_to_be_rasterized);
+ // Inform the client that will likely require a draw if the highest priority
+ // tile that will be rasterized is required for draw.
+ client_->SetIsLikelyToRequireADraw(
+ !tiles_that_need_to_be_rasterized.empty() &&
+ (*tiles_that_need_to_be_rasterized.begin())->required_for_draw());
+
// |tiles_that_need_to_be_rasterized| will be empty when we reach a
// steady memory state. Keep scheduling tasks until we reach this state.
if (!tiles_that_need_to_be_rasterized.empty()) {
« no previous file with comments | « cc/resources/tile_manager.h ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698