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

Unified Diff: cc/resources/tile_manager.cc

Issue 366113002: cc: Do not cleanup tiles with raster tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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') | no next file » | 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 d508f6a0a17a5639290949fb9cf083eb4ffb6e10..b14e58650837d02bdf4e38e8da9fb6fbe76af6e9 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -394,7 +394,6 @@ TileManager::~TileManager() {
RasterTaskQueue empty;
rasterizer_->ScheduleTasks(&empty);
- orphan_raster_tasks_.clear();
// This should finish all pending tasks and release any uninitialized
// resources.
@@ -420,16 +419,22 @@ bool TileManager::ShouldForceTasksRequiredForActivationToComplete() const {
void TileManager::CleanUpReleasedTiles() {
for (std::vector<Tile*>::iterator it = released_tiles_.begin();
- it != released_tiles_.end();
- ++it) {
+ it != released_tiles_.end();) {
reveman 2014/07/03 18:12:47 nit: I prefer if you use a while loop when iterati
sohanjg 2014/07/04 11:56:58 Done.
Tile* tile = *it;
ManagedTileState& mts = tile->managed_state();
+ bool tile_has_raster_task = false;
for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
- FreeResourceForTile(tile, static_cast<RasterMode>(mode));
- orphan_raster_tasks_.push_back(mts.tile_versions[mode].raster_task_);
+ if (!mts.tile_versions[mode].raster_task_)
+ FreeResourceForTile(tile, static_cast<RasterMode>(mode));
reveman 2014/07/03 18:12:47 I think it's a bit confusing that this code could
sohanjg 2014/07/04 11:56:58 Done.
vmpstr 2014/07/05 17:42:19 I actually think we should always release all reso
reveman 2014/07/07 18:15:16 Fine with me if actually worthwhile. Would we not
sohanjg 2014/07/08 06:21:15 Done.
+ else
+ tile_has_raster_task = true;
}
+ if (tile_has_raster_task) {
+ ++it;
+ continue;
+ }
reveman 2014/07/03 18:12:47 nit: blank line here
sohanjg 2014/07/04 11:56:58 Done.
DCHECK(tiles_.find(tile->id()) != tiles_.end());
tiles_.erase(tile->id());
@@ -441,10 +446,9 @@ void TileManager::CleanUpReleasedTiles() {
image_decode_tasks_.erase(tile->layer_id());
}
+ it = released_tiles_.erase(it);
reveman 2014/07/03 18:12:47 nit: move this below "delete tile;" to maintain th
sohanjg 2014/07/04 11:56:58 Done.
delete tile;
}
-
- released_tiles_.clear();
}
void TileManager::UpdatePrioritizedTileSetIfNeeded() {
@@ -970,11 +974,6 @@ void TileManager::ScheduleTasks(
// in |raster_tasks_|.
rasterizer_->ScheduleTasks(&raster_queue_);
- // It's now safe to clean up orphan tasks as raster worker pool is not
- // allowed to keep around unreferenced raster tasks after ScheduleTasks() has
- // been called.
- orphan_raster_tasks_.clear();
-
did_check_for_completed_tasks_since_last_schedule_tasks_ = false;
}
@@ -1078,8 +1077,6 @@ void TileManager::OnRasterTaskCompleted(
Tile* tile = it->second;
ManagedTileState& mts = tile->managed_state();
ManagedTileState::TileVersion& tile_version = mts.tile_versions[raster_mode];
- DCHECK(tile_version.raster_task_);
- orphan_raster_tasks_.push_back(tile_version.raster_task_);
tile_version.raster_task_ = NULL;
if (was_canceled) {
« no previous file with comments | « cc/resources/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698