Commit f0d165f7 authored by vmpstr@chromium.org's avatar vmpstr@chromium.org

cc: Remove layers that are not drawn from tile manager.

This patch removes layers that are no longer have their tile priorities
updated from tile manager, in order to ensure that we don't process
tile or use any other information from these layers.

BUG=176557
R=enne

Review URL: https://codereview.chromium.org/279543003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270247 0039d316-1c4b-4281-b951-d872f2087c98
parent b7105f1b
......@@ -359,10 +359,16 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
}
void PictureLayerImpl::DidUnregisterLayer() {
TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer");
layer_needs_to_register_itself_ = true;
RemoveAllTilings();
}
void PictureLayerImpl::UpdateTilePriorities() {
TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
DCHECK(IsDrawnRenderSurfaceLayerListMember());
DCHECK(!needs_post_commit_initialization_);
CHECK(should_update_tile_priorities_);
......
......@@ -678,6 +678,19 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
}
}
void TileManager::CleanUpLayers() {
for (size_t i = 0; i < layers_.size(); ++i) {
if (layers_[i]->IsDrawnRenderSurfaceLayerListMember())
continue;
layers_[i]->DidUnregisterLayer();
std::swap(layers_[i], layers_.back());
layers_.pop_back();
--i;
prioritized_tiles_dirty_ = true;
}
}
void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
TRACE_EVENT0("cc", "TileManager::ManageTiles");
......@@ -687,6 +700,8 @@ void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
prioritized_tiles_dirty_ = true;
}
CleanUpLayers();
// We need to call CheckForCompletedTasks() once in-between each call
// to ScheduleTasks() to prevent canceled tasks from being scheduled.
if (!did_check_for_completed_tasks_since_last_schedule_tasks_) {
......
......@@ -286,6 +286,7 @@ class CC_EXPORT TileManager : public RasterizerClient,
scoped_refptr<RasterTask> CreateRasterTask(Tile* tile);
scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const;
void UpdatePrioritizedTileSetIfNeeded();
void CleanUpLayers();
TileManagerClient* client_;
ResourcePool* resource_pool_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment