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

Unified Diff: cc/surfaces/display.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/video_resource_updater.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index 8833037c5ecbd822fc554b6697657c59b474739e..763b81c070054838c1554a0f03b47970f1867aa9 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -168,10 +168,16 @@ void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
client_->SetMemoryPolicy(policy);
}
-void Display::OnSurfaceDamaged(SurfaceId surface) {
+void Display::OnSurfaceDamaged(SurfaceId surface_id) {
if (aggregator_ &&
- aggregator_->previous_contained_surfaces().count(surface)) {
- aggregator_->ReleaseResources(surface);
+ aggregator_->previous_contained_surfaces().count(surface_id)) {
+ Surface* surface = manager_->GetSurfaceForId(surface_id);
+ if (surface) {
+ const CompositorFrame* current_frame = surface->GetEligibleFrame();
+ if (!current_frame || !current_frame->delegated_frame_data ||
+ !current_frame->delegated_frame_data->resource_list.size())
+ aggregator_->ReleaseResources(surface_id);
+ }
client_->DisplayDamaged();
}
}
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698