summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_output_surface.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/test/fake_output_surface.cc')
-rw-r--r--cc/test/fake_output_surface.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 6694b06..09af44c 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -16,6 +16,7 @@ FakeOutputSurface::FakeOutputSurface(
scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
bool delegated_rendering)
: OutputSurface(context3d.Pass()),
+ client_(NULL),
num_sent_frames_(0),
needs_begin_frame_(false),
forced_draw_to_software_device_(false),
@@ -29,6 +30,7 @@ FakeOutputSurface::FakeOutputSurface(
FakeOutputSurface::FakeOutputSurface(
scoped_ptr<SoftwareOutputDevice> software_device, bool delegated_rendering)
: OutputSurface(software_device.Pass()),
+ client_(NULL),
num_sent_frames_(0),
forced_draw_to_software_device_(false),
fake_weak_ptr_factory_(this) {
@@ -43,6 +45,7 @@ FakeOutputSurface::FakeOutputSurface(
scoped_ptr<SoftwareOutputDevice> software_device,
bool delegated_rendering)
: OutputSurface(context3d.Pass(), software_device.Pass()),
+ client_(NULL),
num_sent_frames_(0),
forced_draw_to_software_device_(false),
fake_weak_ptr_factory_(this) {
@@ -91,6 +94,15 @@ bool FakeOutputSurface::ForcedDrawToSoftwareDevice() const {
return forced_draw_to_software_device_;
}
+bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) {
+ if (OutputSurface::BindToClient(client)) {
+ client_ = client;
+ return true;
+ } else {
+ return false;
+ }
+}
+
bool FakeOutputSurface::SetAndInitializeContext3D(
scoped_ptr<WebKit::WebGraphicsContext3D> context3d) {
context3d_.reset();
@@ -98,4 +110,10 @@ bool FakeOutputSurface::SetAndInitializeContext3D(
scoped_refptr<ContextProvider>());
}
+void FakeOutputSurface::SetTreeActivationCallback(
+ const base::Closure& callback) {
+ DCHECK(client_);
+ client_->SetTreeActivationCallback(callback);
+}
+
} // namespace cc