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