summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/webplugin_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/plugin/webplugin_proxy.cc')
-rw-r--r--chrome/plugin/webplugin_proxy.cc44
1 files changed, 40 insertions, 4 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 5441dc8..5ec1b43 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -23,6 +23,9 @@
#include "chrome/plugin/npobject_util.h"
#include "chrome/plugin/plugin_channel.h"
#include "chrome/plugin/plugin_thread.h"
+#if defined(OS_MACOSX)
+#include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h"
+#endif
#include "gfx/blit.h"
#include "gfx/canvas.h"
#if defined(OS_WIN)
@@ -38,6 +41,9 @@
using WebKit::WebBindings;
using webkit_glue::WebPluginResourceClient;
+#if defined(OS_MACOSX)
+using webkit_glue::WebPluginAcceleratedSurface;
+#endif
typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap;
static ContextMap& GetContextMap() {
@@ -92,6 +98,12 @@ WebPluginProxy::~WebPluginProxy() {
if (windowless_shm_pixmap_ != None)
XFreePixmap(x11_util::GetXDisplay(), windowless_shm_pixmap_);
#endif
+
+#if defined(OS_MACOSX)
+ // Destroy the surface early, since it may send messages during cleanup.
+ if (accelerated_surface_.get())
+ accelerated_surface_.reset();
+#endif
}
bool WebPluginProxy::Send(IPC::Message* msg) {
@@ -640,17 +652,41 @@ void WebPluginProxy::BindFakePluginWindowHandle(bool opaque) {
Send(new PluginHostMsg_BindFakePluginWindowHandle(route_id_, opaque));
}
+WebPluginAcceleratedSurface* WebPluginProxy::GetAcceleratedSurface() {
+ if (!accelerated_surface_.get())
+ accelerated_surface_.reset(new WebPluginAcceleratedSurfaceProxy(this));
+ return accelerated_surface_.get();
+}
+
void WebPluginProxy::AcceleratedFrameBuffersDidSwap(
gfx::PluginWindowHandle window) {
Send(new PluginHostMsg_AcceleratedSurfaceBuffersSwapped(route_id_, window));
}
-void WebPluginProxy::SetAcceleratedSurface(gfx::PluginWindowHandle window,
- int32 width,
- int32 height,
+void WebPluginProxy::SetAcceleratedSurface(
+ gfx::PluginWindowHandle window,
+ const gfx::Size& size,
uint64 accelerated_surface_identifier) {
Send(new PluginHostMsg_AcceleratedSurfaceSetIOSurface(
- route_id_, window, width, height, accelerated_surface_identifier));
+ route_id_, window, size.width(), size.height(),
+ accelerated_surface_identifier));
+}
+
+void WebPluginProxy::SetAcceleratedDIB(
+ gfx::PluginWindowHandle window,
+ const gfx::Size& size,
+ const TransportDIB::Handle& dib_handle) {
+ Send(new PluginHostMsg_AcceleratedSurfaceSetTransportDIB(
+ route_id_, window, size.width(), size.height(), dib_handle));
+}
+
+void WebPluginProxy::AllocSurfaceDIB(const size_t size,
+ TransportDIB::Handle* dib_handle) {
+ Send(new PluginHostMsg_AllocTransportDIB(route_id_, size, dib_handle));
+}
+
+void WebPluginProxy::FreeSurfaceDIB(TransportDIB::Id dib_id) {
+ Send(new PluginHostMsg_FreeTransportDIB(route_id_, dib_id));
}
#endif