OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 6 #include "webkit/compositor_bindings/web_compositor_support_output_surface.h" |
| 7 |
| 8 namespace webkit { |
| 9 |
| 10 WebCompositorSupportOutputSurface::WebCompositorSupportOutputSurface( |
| 11 scoped_ptr<WebKit::WebGraphicsContext3D> context3d) { |
| 12 context3d_ = context3d.Pass(); |
| 13 } |
| 14 |
| 15 WebCompositorSupportOutputSurface::WebCompositorSupportOutputSurface( |
| 16 scoped_ptr<cc::SoftwareOutputDevice> software_device) { |
| 17 software_device_ = software_device.Pass(); |
| 18 } |
| 19 |
| 20 WebCompositorSupportOutputSurface::~WebCompositorSupportOutputSurface() {} |
| 21 |
| 22 bool WebCompositorSupportOutputSurface::BindToClient( |
| 23 cc::OutputSurfaceClient* client) { |
| 24 if (!context3d_) |
| 25 return true; |
| 26 DCHECK(client); |
| 27 return context3d_->makeContextCurrent(); |
| 28 } |
| 29 |
| 30 const struct cc::OutputSurface::Capabilities& |
| 31 WebCompositorSupportOutputSurface::Capabilities() const { |
| 32 return capabilities_; |
| 33 } |
| 34 |
| 35 WebKit::WebGraphicsContext3D* WebCompositorSupportOutputSurface::Context3D() con
st { |
| 36 return context3d_.get(); |
| 37 } |
| 38 |
| 39 cc::SoftwareOutputDevice* WebCompositorSupportOutputSurface::SoftwareDevice() co
nst { |
| 40 return software_device_.get(); |
| 41 } |
| 42 |
| 43 void WebCompositorSupportOutputSurface::SendFrameToParentCompositor( |
| 44 const cc::CompositorFrame&) { |
| 45 // No support for delegated renderers in DumpRenderTree. |
| 46 NOTREACHED(); |
| 47 } |
| 48 |
| 49 } // namespace webkit |
OLD | NEW |