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.
5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_
6 #define CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_
8 #include "base/compiler_specific.h"
9 #include "content/child/npapi/webplugin_accelerated_surface_mac.h"
10 #include "ui/gl/gpu_preference.h"
12 class AcceleratedSurface
;
17 // Out-of-process implementation of WebPluginAcceleratedSurface that proxies
18 // calls through a WebPluginProxy.
19 class WebPluginAcceleratedSurfaceProxy
: public WebPluginAcceleratedSurface
{
21 // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy
22 // to proxy calls. plugin_proxy must outlive this object. Returns NULL if
23 // initialization fails.
24 static WebPluginAcceleratedSurfaceProxy
* Create(
25 WebPluginProxy
* plugin_proxy
,
26 gfx::GpuPreference gpu_preference
);
28 ~WebPluginAcceleratedSurfaceProxy() override
;
30 // WebPluginAcceleratedSurface implementation.
31 void SetSize(const gfx::Size
& size
) override
;
32 CGLContextObj
context() override
;
33 void StartDrawing() override
;
34 void EndDrawing() override
;
37 WebPluginAcceleratedSurfaceProxy(WebPluginProxy
* plugin_proxy
,
38 AcceleratedSurface
* surface
);
40 WebPluginProxy
* plugin_proxy_
; // Weak ref.
41 AcceleratedSurface
* surface_
;
43 DISALLOW_COPY_AND_ASSIGN(WebPluginAcceleratedSurfaceProxy
);
46 } // namespace content
48 #endif // CONTENT_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_