diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 21:43:16 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 21:43:16 +0000 |
commit | a46f329337fb3568d73453a28e23124933b8fda7 (patch) | |
tree | ff3f80e9527604104b6b47341ba89c0ebef870ba /cc/test/fake_output_surface.cc | |
parent | f850763f96d4b98b4ebf8fa0270b3ac77da169e7 (diff) | |
download | chromium_src-a46f329337fb3568d73453a28e23124933b8fda7.zip chromium_src-a46f329337fb3568d73453a28e23124933b8fda7.tar.gz chromium_src-a46f329337fb3568d73453a28e23124933b8fda7.tar.bz2 |
cc: Move WebCompositorOutputSurface and related classes into cc/
This moves:
- WebKit::WebCompositorOutputSurface to cc::OutputSurface
- WebKit::WebCompositorOutputSurfaceClient to cc::OutputSurfaceClient
- Webkit::WebCompositorSoftwareOutputDevice to cc::SoftwareOutputDevice
They become new files in cc/ so they are chromified style. This affects
the various call-sites. This allows us to pass cc::CompositorFrame
directly, without any need for WebCompositorFrame.
BUG=146080
Depends on: https://bugs.webkit.org/show_bug.cgi?id=103967
Review URL: https://codereview.chromium.org/11348371
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_output_surface.cc')
-rw-r--r-- | cc/test/fake_output_surface.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc new file mode 100644 index 0000000..6d1e972 --- /dev/null +++ b/cc/test/fake_output_surface.cc @@ -0,0 +1,46 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/test/fake_output_surface.h" + +namespace cc { + +FakeOutputSurface::FakeOutputSurface( + scoped_ptr<WebKit::WebGraphicsContext3D> context3d) { + context3d_ = context3d.Pass(); +} + +FakeOutputSurface::FakeOutputSurface( + scoped_ptr<SoftwareOutputDevice> software_device) { + software_device_ = software_device.Pass(); +} + +FakeOutputSurface::~FakeOutputSurface() {} + +bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { + if (!context3d_) + return true; + 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(); +} + +void FakeOutputSurface::SendFrameToParentCompositor(const CompositorFrame&) {} + +} // namespace cc |