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

Unified Diff: cc/surfaces/surface.cc

Issue 2688043002: Retain references to surfaces from both active AND pending CompositorFrames (Closed)
Patch Set: Added TODOs and addressed comments Created 3 years, 10 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/surfaces/surface.h ('k') | cc/surfaces/surface_dependency_tracker.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 57e3a3c98f3c47e4a35a5256a168900be8d0794b..c2ab3541abca7fa12fb9dcfd0f0a18ac3ab28de1 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -63,6 +63,8 @@ void Surface::QueueFrame(CompositorFrame frame, const DrawCallback& callback) {
pending_frame_ = std::move(frame);
if (pending_frame_) {
factory_->ReceiveFromChild(pending_frame_->resource_list);
+ pending_referenced_surfaces_ =
+ pending_frame_->metadata.referenced_surfaces;
// Ask the surface manager to inform |this| when its dependencies are
// resolved.
factory_->manager()->RequestSurfaceResolution(this);
@@ -149,6 +151,7 @@ void Surface::ActivatePendingFrame() {
DCHECK(pending_frame_);
ActivateFrame(std::move(pending_frame_.value()));
pending_frame_.reset();
+ pending_referenced_surfaces_.clear();
// ActiveFrame resources are now double ref-ed. Unref.
UnrefFrameResources(*active_frame_);
}
@@ -177,7 +180,7 @@ void Surface::ActivateFrame(CompositorFrame frame) {
if (previous_frame)
UnrefFrameResources(*previous_frame);
- referenced_surfaces_ = active_frame_->metadata.referenced_surfaces;
+ active_referenced_surfaces_ = active_frame_->metadata.referenced_surfaces;
for (auto& observer : observers_)
observer.OnSurfaceActivated(this);
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_dependency_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698