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

Unified Diff: cc/surfaces/surface.cc

Issue 565313003: Support doing CopyOutputRequests on surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 8f08d63d9275e9d77d6c1e0fa912b98524272237..d58ed4cc18046fbc667d7490d011436a3cff5a86 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -22,6 +22,12 @@ Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory)
}
Surface::~Surface() {
+ for (ScopedPtrVector<CopyOutputRequest>::iterator it = copy_requests_.begin();
+ it != copy_requests_.end();
+ ++it) {
+ (*it)->SendEmptyResult();
+ }
+ copy_requests_.clear();
if (current_frame_) {
ReturnedResourceArray current_resources;
TransferableResource::ReturnResources(
@@ -33,6 +39,13 @@ Surface::~Surface() {
void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
const base::Closure& callback) {
+ for (ScopedPtrVector<CopyOutputRequest>::iterator it = copy_requests_.begin();
+ it != copy_requests_.end();
+ ++it) {
+ (*it)->SendEmptyResult();
+ }
+ copy_requests_.clear();
+
TakeLatencyInfo(&frame->metadata.latency_info);
scoped_ptr<CompositorFrame> previous_frame = current_frame_.Pass();
current_frame_ = frame.Pass();
@@ -53,8 +66,13 @@ void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
}
void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) {
- // TODO(jbauman): Make this work.
- copy_request->SendEmptyResult();
+ copy_requests_.push_back(copy_request.Pass());
+}
+
+void Surface::TakeCopyOutputRequests(
+ ScopedPtrVector<CopyOutputRequest>* copy_requests) {
+ DCHECK(copy_requests->empty());
+ copy_requests->swap(copy_requests_);
}
const CompositorFrame* Surface::GetEligibleFrame() {
« 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