diff options
Diffstat (limited to 'cc/test/fake_output_surface.cc')
-rw-r--r-- | cc/test/fake_output_surface.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc index 09af44c..9ae7552 100644 --- a/cc/test/fake_output_surface.cc +++ b/cc/test/fake_output_surface.cc @@ -61,6 +61,14 @@ void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) { if (frame->software_frame_data || frame->delegated_frame_data || !context3d()) { frame->AssignTo(&last_sent_frame_); + + if (last_sent_frame_.delegated_frame_data) { + resources_held_by_parent_.insert( + resources_held_by_parent_.end(), + last_sent_frame_.delegated_frame_data->resource_list.begin(), + last_sent_frame_.delegated_frame_data->resource_list.end()); + } + ++num_sent_frames_; PostSwapBuffersComplete(); DidSwapBuffers(); @@ -116,4 +124,17 @@ void FakeOutputSurface::SetTreeActivationCallback( client_->SetTreeActivationCallback(callback); } +void FakeOutputSurface::ReturnResource(unsigned id, CompositorFrameAck* ack) { + TransferableResourceArray::iterator it; + for (it = resources_held_by_parent_.begin(); + it != resources_held_by_parent_.end(); + ++it) { + if (it->id == id) + break; + } + DCHECK(it != resources_held_by_parent_.end()); + ack->resources.push_back(*it); + resources_held_by_parent_.erase(it); +} + } // namespace cc |