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

Unified Diff: cc/surfaces/surface.cc

Issue 2695243006: Don't delete CopyOutputRequests when queueing a new Surface frame. (Closed)
Patch Set: add test 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_aggregator.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 6f482f56eb0c7ca96c35f28a44c54f2ecd3f01a5..81839aecca0939fbc271a12411ec266f8bea09d6 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -32,6 +32,8 @@ Surface::Surface(const SurfaceId& id, base::WeakPtr<SurfaceFactory> factory)
Surface::~Surface() {
ClearCopyRequests();
danakj 2017/02/23 22:52:28 Can you change this things name maybe so it doesn'
+ for (auto& request : copy_requests_)
+ request->SendEmptyResult();
if (factory_) {
if (pending_frame_)
UnrefFrameResources(*pending_frame_);
@@ -101,21 +103,18 @@ void Surface::RequestCopyOfOutput(
return;
}
- std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests =
- active_frame_->render_pass_list.back()->copy_requests;
-
if (copy_request->has_source()) {
const base::UnguessableToken& source = copy_request->source();
// Remove existing CopyOutputRequests made on the Surface by the same
// source.
auto to_remove =
- std::remove_if(copy_requests.begin(), copy_requests.end(),
+ std::remove_if(copy_requests_.begin(), copy_requests_.end(),
[&source](const std::unique_ptr<CopyOutputRequest>& x) {
return x->has_source() && x->source() == source;
});
- copy_requests.erase(to_remove, copy_requests.end());
+ copy_requests_.erase(to_remove, copy_requests_.end());
}
- copy_requests.push_back(std::move(copy_request));
+ copy_requests_.push_back(std::move(copy_request));
}
void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) {
@@ -252,6 +251,18 @@ void Surface::TakeCopyOutputRequests(
}
render_pass->copy_requests.clear();
}
+
+ if (active_frame_->render_pass_list.size() > 0) {
+ int root_pass_id = active_frame_->render_pass_list.back()->id;
+ for (auto& request : copy_requests_) {
+ copy_requests->insert(std::make_pair(root_pass_id, std::move(request)));
+ }
+ copy_requests_.clear();
+ } else {
+ for (auto& request : copy_requests_)
+ request->SendEmptyResult();
+ copy_requests_.clear();
+ }
}
const CompositorFrame& Surface::GetActiveFrame() const {
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698