From 79a1be5675c89e740725d52fb56ba0295f3333be Mon Sep 17 00:00:00 2001 From: "skaslev@chromium.org" Date: Wed, 13 Feb 2013 23:59:50 +0000 Subject: Have a common implementation of cc::OutputSurface instead of multiple duplicated ones. Review URL: https://codereview.chromium.org/12041062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182345 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/test/fake_output_surface.cc | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'cc/test/fake_output_surface.cc') diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc index ebbe783..0b9a6d3 100644 --- a/cc/test/fake_output_surface.cc +++ b/cc/test/fake_output_surface.cc @@ -8,41 +8,27 @@ namespace cc { FakeOutputSurface::FakeOutputSurface( scoped_ptr context3d, bool has_parent) - : num_sent_frames_(0) { - context3d_ = context3d.Pass(); + : OutputSurface(context3d.Pass()), + num_sent_frames_(0) { capabilities_.has_parent_compositor = has_parent; } FakeOutputSurface::FakeOutputSurface( scoped_ptr software_device, bool has_parent) - : num_sent_frames_(0) { - software_device_ = software_device.Pass(); + : OutputSurface(software_device.Pass()), + num_sent_frames_(0) { capabilities_.has_parent_compositor = has_parent; } FakeOutputSurface::~FakeOutputSurface() {} -bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { - if (!context3d_) - return true; +bool FakeOutputSurface::BindToClient( + cc::OutputSurfaceClient* client) { DCHECK(client); - if (!context3d_->makeContextCurrent()) - return false; client_ = client; - return true; -} - -const struct OutputSurface::Capabilities& FakeOutputSurface::Capabilities() - const { - return capabilities_; -} - -WebKit::WebGraphicsContext3D* FakeOutputSurface::Context3D() const { - return context3d_.get(); -} - -SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { - return software_device_.get(); + if (!context3d_) + return true; + return context3d_->makeContextCurrent(); } void FakeOutputSurface::SendFrameToParentCompositor( -- cgit v1.1