diff options
author | skaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 23:59:50 +0000 |
---|---|---|
committer | skaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 23:59:50 +0000 |
commit | 79a1be5675c89e740725d52fb56ba0295f3333be (patch) | |
tree | b22a153b187201e563cf16e91f1e46bf7ef4a33a /cc/test/fake_output_surface.cc | |
parent | 490ccaf2705fcda0afeefb717a023aa5e1fe8076 (diff) | |
download | chromium_src-79a1be5675c89e740725d52fb56ba0295f3333be.zip chromium_src-79a1be5675c89e740725d52fb56ba0295f3333be.tar.gz chromium_src-79a1be5675c89e740725d52fb56ba0295f3333be.tar.bz2 |
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
Diffstat (limited to 'cc/test/fake_output_surface.cc')
-rw-r--r-- | cc/test/fake_output_surface.cc | 32 |
1 files changed, 9 insertions, 23 deletions
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<WebKit::WebGraphicsContext3D> 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<SoftwareOutputDevice> 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( |