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