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

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

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.

R=enne
BUG=176557, 358350

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271143 0039d316-1c4b-4281-b951-d872f2087c98
parent 04a92ba4
......@@ -358,10 +358,14 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
}
void PictureLayerImpl::DidUnregisterLayer() {
TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer");
layer_needs_to_register_itself_ = true;
}
void PictureLayerImpl::UpdateTilePriorities() {
TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
DCHECK(!needs_post_commit_initialization_);
CHECK(should_update_tile_priorities_);
......
......@@ -677,6 +677,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");
......@@ -686,6 +699,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_) {
......
......@@ -292,6 +292,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