| 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() {
|
|
|