OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/output_surface_impl.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 OutputSurfaceImpl::OutputSurfaceImpl( |
| 13 scoped_ptr<WebKit::WebGraphicsContext3D> context3d) |
| 14 : client_(NULL), |
| 15 context3d_(context3d.Pass()) { |
| 16 } |
| 17 |
| 18 OutputSurfaceImpl::OutputSurfaceImpl( |
| 19 scoped_ptr<cc::SoftwareOutputDevice> software_device) |
| 20 : client_(NULL), |
| 21 software_device_(software_device.Pass()) { |
| 22 } |
| 23 |
| 24 OutputSurfaceImpl::OutputSurfaceImpl( |
| 25 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
| 26 scoped_ptr<cc::SoftwareOutputDevice> software_device) |
| 27 : client_(NULL), |
| 28 context3d_(context3d.Pass()), |
| 29 software_device_(software_device.Pass()) { |
| 30 } |
| 31 |
| 32 OutputSurfaceImpl::~OutputSurfaceImpl() {} |
| 33 |
| 34 bool OutputSurfaceImpl::BindToClient( |
| 35 cc::OutputSurfaceClient* client) { |
| 36 DCHECK(client); |
| 37 if (!context3d_) |
| 38 return true; |
| 39 client_ = client; |
| 40 return context3d_->makeContextCurrent(); |
| 41 } |
| 42 |
| 43 const struct cc::OutputSurface::Capabilities& |
| 44 OutputSurfaceImpl::Capabilities() const { |
| 45 return capabilities_; |
| 46 } |
| 47 |
| 48 WebKit::WebGraphicsContext3D* OutputSurfaceImpl::Context3D() const { |
| 49 return context3d_.get(); |
| 50 } |
| 51 |
| 52 cc::SoftwareOutputDevice* OutputSurfaceImpl::SoftwareDevice() const { |
| 53 return software_device_.get(); |
| 54 } |
| 55 |
| 56 void OutputSurfaceImpl::SendFrameToParentCompositor( |
| 57 cc::CompositorFrame*) { |
| 58 } |
| 59 |
| 60 } // namespace cc |
OLD | NEW |