| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/gfx/gl/gpu_preference.h" | 10 #include "ui/gfx/gl/gpu_preference.h" |
| 11 #include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" | 11 #include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" |
| 12 | 12 |
| 13 class WebPluginProxy; | 13 class WebPluginProxy; |
| 14 class AcceleratedSurface; | 14 class AcceleratedSurface; |
| 15 | 15 |
| 16 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies | 16 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies |
| 17 // calls through a WebPluginProxy. | 17 // calls through a WebPluginProxy. |
| 18 class WebPluginAcceleratedSurfaceProxy | 18 class WebPluginAcceleratedSurfaceProxy |
| 19 : public webkit::npapi::WebPluginAcceleratedSurface { | 19 : public webkit::npapi::WebPluginAcceleratedSurface { |
| 20 public: | 20 public: |
| 21 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy | 21 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy |
| 22 // to proxy calls. plugin_proxy must outlive this object. | 22 // to proxy calls. plugin_proxy must outlive this object. Returns NULL if |
| 23 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, | 23 // initialization fails. |
| 24 gfx::GpuPreference gpu_preference); | 24 static WebPluginAcceleratedSurfaceProxy* Create( |
| 25 WebPluginProxy* plugin_proxy, |
| 26 gfx::GpuPreference gpu_preference); |
| 27 |
| 25 virtual ~WebPluginAcceleratedSurfaceProxy(); | 28 virtual ~WebPluginAcceleratedSurfaceProxy(); |
| 26 | 29 |
| 27 // WebPluginAcceleratedSurface implementation. | 30 // WebPluginAcceleratedSurface implementation. |
| 28 virtual void SetWindowHandle(gfx::PluginWindowHandle window) OVERRIDE; | 31 virtual void SetWindowHandle(gfx::PluginWindowHandle window) OVERRIDE; |
| 32 virtual bool IsComposited() OVERRIDE; |
| 29 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 33 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 30 virtual CGLContextObj context() OVERRIDE; | 34 virtual CGLContextObj context() OVERRIDE; |
| 31 virtual void StartDrawing() OVERRIDE; | 35 virtual void StartDrawing() OVERRIDE; |
| 32 virtual void EndDrawing() OVERRIDE; | 36 virtual void EndDrawing() OVERRIDE; |
| 33 | 37 |
| 34 private: | 38 private: |
| 39 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, |
| 40 AcceleratedSurface* surface, |
| 41 bool composited); |
| 42 |
| 35 WebPluginProxy* plugin_proxy_; // Weak ref. | 43 WebPluginProxy* plugin_proxy_; // Weak ref. |
| 36 gfx::PluginWindowHandle window_handle_; | 44 gfx::PluginWindowHandle window_handle_; |
| 37 AcceleratedSurface* surface_; | 45 AcceleratedSurface* surface_; |
| 46 bool composited_; |
| 38 | 47 |
| 39 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); | 48 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); |
| 40 }; | 49 }; |
| 41 | 50 |
| 42 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ | 51 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ |
| OLD | NEW |