summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_output_surface.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-09 07:50:17 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-09 07:50:17 +0000
commit021eff5d0b5451997188e3e4d7e41a40b74dc5ca (patch)
tree0b6bd3779eaf45af84832e1580963101b0261824 /cc/test/fake_output_surface.cc
parentf36e51e9d15183351c4eb555d2b2a3bfe1a1b28b (diff)
downloadchromium_src-021eff5d0b5451997188e3e4d7e41a40b74dc5ca.zip
chromium_src-021eff5d0b5451997188e3e4d7e41a40b74dc5ca.tar.gz
chromium_src-021eff5d0b5451997188e3e4d7e41a40b74dc5ca.tar.bz2
cc: Make DelegatedRendererLayer tests work with a DelegatingRenderer.
These tests now work to demonstrate how a DelegatedRendererLayer works if the Compositor is not the root compositor, and they must delegate to another parent compositor. R=piman BUG=239290 Review URL: https://chromiumcodereview.appspot.com/22725002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_output_surface.cc')
-rw-r--r--cc/test/fake_output_surface.cc21
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