| 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 "ui/gfx/gl/gpu_preference.h" | 10 #include "ui/gfx/gl/gpu_preference.h" |
| 10 #include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" | 11 #include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" |
| 11 | 12 |
| 12 class WebPluginProxy; | 13 class WebPluginProxy; |
| 13 class AcceleratedSurface; | 14 class AcceleratedSurface; |
| 14 | 15 |
| 15 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies | 16 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies |
| 16 // calls through a WebPluginProxy. | 17 // calls through a WebPluginProxy. |
| 17 class WebPluginAcceleratedSurfaceProxy | 18 class WebPluginAcceleratedSurfaceProxy |
| 18 : public webkit::npapi::WebPluginAcceleratedSurface { | 19 : public webkit::npapi::WebPluginAcceleratedSurface { |
| 19 public: | 20 public: |
| 20 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy | 21 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy |
| 21 // to proxy calls. plugin_proxy must outlive this object. | 22 // to proxy calls. plugin_proxy must outlive this object. |
| 22 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, | 23 WebPluginAcceleratedSurfaceProxy(WebPluginProxy* plugin_proxy, |
| 23 gfx::GpuPreference gpu_preference); | 24 gfx::GpuPreference gpu_preference); |
| 24 virtual ~WebPluginAcceleratedSurfaceProxy(); | 25 virtual ~WebPluginAcceleratedSurfaceProxy(); |
| 25 | 26 |
| 26 // WebPluginAcceleratedSurface implementation. | 27 // WebPluginAcceleratedSurface implementation. |
| 27 virtual void SetWindowHandle(gfx::PluginWindowHandle window); | 28 virtual void SetWindowHandle(gfx::PluginWindowHandle window) OVERRIDE; |
| 28 virtual void SetSize(const gfx::Size& size); | 29 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 29 virtual CGLContextObj context(); | 30 virtual CGLContextObj context() OVERRIDE; |
| 30 virtual void StartDrawing(); | 31 virtual void StartDrawing() OVERRIDE; |
| 31 virtual void EndDrawing(); | 32 virtual void EndDrawing() OVERRIDE; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 WebPluginProxy* plugin_proxy_; // Weak ref. | 35 WebPluginProxy* plugin_proxy_; // Weak ref. |
| 35 gfx::PluginWindowHandle window_handle_; | 36 gfx::PluginWindowHandle window_handle_; |
| 36 AcceleratedSurface* surface_; | 37 AcceleratedSurface* surface_; |
| 37 | 38 |
| 38 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); | 39 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ | 42 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ |
| OLD | NEW |