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 #ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_OUTPUT_SURFACE |
| 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_OUTPUT_SURFACE |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/output_surface.h" |
| 10 #include "webkit/compositor_bindings/web_compositor_support_software_output_devi
ce.h" |
| 11 |
| 12 namespace webkit { |
| 13 |
| 14 class WebCompositorSupportOutputSurface : public cc::OutputSurface { |
| 15 public: |
| 16 |
| 17 static inline scoped_ptr<WebCompositorSupportOutputSurface> Create3d( |
| 18 scoped_ptr<WebKit::WebGraphicsContext3D> context3d) { |
| 19 return make_scoped_ptr( |
| 20 new WebCompositorSupportOutputSurface(context3d.Pass())); |
| 21 } |
| 22 |
| 23 static inline scoped_ptr<WebCompositorSupportOutputSurface> CreateSoftware( |
| 24 scoped_ptr<cc::SoftwareOutputDevice> software_device) { |
| 25 return make_scoped_ptr( |
| 26 new WebCompositorSupportOutputSurface(software_device.Pass())); |
| 27 } |
| 28 |
| 29 virtual ~WebCompositorSupportOutputSurface(); |
| 30 |
| 31 virtual bool BindToClient(cc::OutputSurfaceClient*) OVERRIDE; |
| 32 |
| 33 virtual const struct Capabilities& Capabilities() const OVERRIDE; |
| 34 |
| 35 virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; |
| 36 virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; |
| 37 |
| 38 virtual void SendFrameToParentCompositor(const cc::CompositorFrame&) OVERRIDE; |
| 39 |
| 40 private: |
| 41 explicit WebCompositorSupportOutputSurface( |
| 42 scoped_ptr<WebKit::WebGraphicsContext3D> context3d); |
| 43 explicit WebCompositorSupportOutputSurface( |
| 44 scoped_ptr<cc::SoftwareOutputDevice> software_device); |
| 45 |
| 46 struct cc::OutputSurface::Capabilities capabilities_; |
| 47 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
| 48 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
| 49 }; |
| 50 |
| 51 } // namespace webkit |
| 52 |
| 53 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_OUTPUT_SURFACE |
OLD | NEW |