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

Unified Diff: cc/surfaces/surface.cc

Issue 2585543003: Revert of Getting rid of CompositorFrameMetadata::satisfies_sequences (Closed)
Patch Set: Created 4 years 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/output/compositor_frame_metadata.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index 282974d22c31ab7fca705000b8d7a35ecd2a3279..d1b59d6b55f22478e65ce5a27a2f3f562dfcbb4c 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -65,6 +65,9 @@
previous_frame_surface_id_ = surface_id();
+ std::vector<SurfaceId> new_referenced_surfaces;
+ new_referenced_surfaces = current_frame_->metadata.referenced_surfaces;
+
if (previous_frame)
UnrefFrameResources(*previous_frame);
@@ -72,7 +75,19 @@
draw_callback_.Run();
draw_callback_ = callback;
- referenced_surfaces_ = current_frame_->metadata.referenced_surfaces;
+ bool referenced_surfaces_changed =
+ (referenced_surfaces_ != new_referenced_surfaces);
+ referenced_surfaces_ = new_referenced_surfaces;
+ std::vector<uint32_t> satisfies_sequences =
+ std::move(current_frame_->metadata.satisfies_sequences);
+
+ if (referenced_surfaces_changed || !satisfies_sequences.empty()) {
+ // Notify the manager that sequences were satisfied either if some new
+ // sequences were satisfied, or if the set of referenced surfaces changed
+ // to force a GC to happen.
+ factory_->manager()->DidSatisfySequences(surface_id_.frame_sink_id(),
+ &satisfies_sequences);
+ }
}
void Surface::EvictFrame() {
« no previous file with comments | « cc/output/compositor_frame_metadata.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698