OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ | 5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ |
6 #define CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ | 6 #define CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "content/child/npapi/webplugin_accelerated_surface_mac.h" |
9 #include "ui/gl/gpu_preference.h" | 10 #include "ui/gl/gpu_preference.h" |
10 #include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" | |
11 | 11 |
12 class AcceleratedSurface; | 12 class AcceleratedSurface; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebPluginProxy; | 15 class WebPluginProxy; |
16 | 16 |
17 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies | 17 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies |
18 // calls through a WebPluginProxy. | 18 // calls through a WebPluginProxy. |
19 class WebPluginAcceleratedSurfaceProxy | 19 class WebPluginAcceleratedSurfaceProxy : public WebPluginAcceleratedSurface { |
20 : public webkit::npapi::WebPluginAcceleratedSurface { | |
21 public: | 20 public: |
22 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy | 21 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy |
23 // to proxy calls. plugin_proxy must outlive this object. Returns NULL if | 22 // to proxy calls. plugin_proxy must outlive this object. Returns NULL if |
24 // initialization fails. | 23 // initialization fails. |
25 static WebPluginAcceleratedSurfaceProxy* Create( | 24 static WebPluginAcceleratedSurfaceProxy* Create( |
26 WebPluginProxy* plugin_proxy, | 25 WebPluginProxy* plugin_proxy, |
27 gfx::GpuPreference gpu_preference); | 26 gfx::GpuPreference gpu_preference); |
28 | 27 |
29 virtual ~WebPluginAcceleratedSurfaceProxy(); | 28 virtual ~WebPluginAcceleratedSurfaceProxy(); |
30 | 29 |
31 // WebPluginAcceleratedSurface implementation. | 30 // WebPluginAcceleratedSurface implementation. |
32 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 31 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
33 virtual CGLContextObj context() OVERRIDE; | 32 virtual CGLContextObj context() OVERRIDE; |
34 virtual void StartDrawing() OVERRIDE; | 33 virtual void StartDrawing() OVERRIDE; |
35 virtual void EndDrawing() OVERRIDE; | 34 virtual void EndDrawing() OVERRIDE; |
36 | 35 |
37 private: | 36 private: |
38 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, | 37 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, |
39 AcceleratedSurface* surface); | 38 AcceleratedSurface* surface); |
40 | 39 |
41 WebPluginProxy* plugin_proxy_; // Weak ref. | 40 WebPluginProxy* plugin_proxy_; // Weak ref. |
42 AcceleratedSurface* surface_; | 41 AcceleratedSurface* surface_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); | 43 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace content | 46 } // namespace content |
48 | 47 |
49 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ | 48 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ |
OLD | NEW |