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

Unified Diff: cc/surfaces/surface.cc

Issue 2695243006: Don't delete CopyOutputRequests when queueing a new Surface frame. (Closed)
Patch Set: rebase 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 | « no previous file | cc/surfaces/surface_unittest.cc » ('j') | cc/surfaces/surface_unittest.cc » ('J')
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 63dd62cc1b005c286c2a5c369cbc91aad51a6c77..393b768d8e77f1feeffd5fa9642b18d69627faee 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -164,6 +164,14 @@ void Surface::ActivatePendingFrame() {
// compositor.
void Surface::ActivateFrame(CompositorFrame frame) {
DCHECK(factory_);
+
+ // Save root pass copy requests.
+ std::vector<std::unique_ptr<CopyOutputRequest>> old_copy_requests;
+ if (active_frame_ && !active_frame_->render_pass_list.empty()) {
+ std::swap(old_copy_requests,
+ active_frame_->render_pass_list.back()->copy_requests);
+ }
+
ClearCopyRequests();
TakeLatencyInfo(&frame.metadata.latency_info);
@@ -171,6 +179,9 @@ void Surface::ActivateFrame(CompositorFrame frame) {
base::Optional<CompositorFrame> previous_frame = std::move(active_frame_);
active_frame_ = std::move(frame);
+ for (auto& copy_request : old_copy_requests)
+ RequestCopyOfOutput(std::move(copy_request));
+
// Empty frames shouldn't be drawn and shouldn't contribute damage, so don't
// increment frame index for them.
if (!active_frame_->render_pass_list.empty())
« no previous file with comments | « no previous file | cc/surfaces/surface_unittest.cc » ('j') | cc/surfaces/surface_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698