| Index: cc/output_surface.cc
|
| diff --git a/cc/output_surface.cc b/cc/output_surface.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ca4a96645fdfe96c083ec209a345a0ae050ed278
|
| --- /dev/null
|
| +++ b/cc/output_surface.cc
|
| @@ -0,0 +1,53 @@
|
| +// Copyright (c) 2013 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/output_surface.h"
|
| +
|
| +#include "base/logging.h"
|
| +
|
| +namespace cc {
|
| +
|
| +OutputSurface::OutputSurface(
|
| + scoped_ptr<WebKit::WebGraphicsContext3D> context3d)
|
| + : client_(NULL),
|
| + context3d_(context3d.Pass()) {
|
| +}
|
| +
|
| +OutputSurface::OutputSurface(
|
| + scoped_ptr<cc::SoftwareOutputDevice> software_device)
|
| + : client_(NULL),
|
| + software_device_(software_device.Pass()) {
|
| +}
|
| +
|
| +OutputSurface::OutputSurface(
|
| + scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
|
| + scoped_ptr<cc::SoftwareOutputDevice> software_device)
|
| + : client_(NULL),
|
| + context3d_(context3d.Pass()),
|
| + software_device_(software_device.Pass()) {
|
| +}
|
| +
|
| +bool OutputSurface::BindToClient(
|
| + cc::OutputSurfaceClient* client) {
|
| + DCHECK(client);
|
| + client_ = client;
|
| + if (!context3d_)
|
| + return true;
|
| + return context3d_->makeContextCurrent();
|
| +}
|
| +
|
| +const struct OutputSurface::Capabilities&
|
| + OutputSurface::Capabilities() const {
|
| + return capabilities_;
|
| +}
|
| +
|
| +WebKit::WebGraphicsContext3D* OutputSurface::Context3D() const {
|
| + return context3d_.get();
|
| +}
|
| +
|
| +cc::SoftwareOutputDevice* OutputSurface::SoftwareDevice() const {
|
| + return software_device_.get();
|
| +}
|
| +
|
| +} // namespace cc
|
|
|