summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/webplugin_proxy.cc
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 18:04:06 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 18:04:06 +0000
commit8b4755fa086ef5d41e6a6ed40a38ac45390b9511 (patch)
tree555a11c1fdaee95ebfb29cdfb9a7a2a7cce9a3c1 /chrome/plugin/webplugin_proxy.cc
parent56bf1b7944f2c7b2a620b0e1476086b7e60f0da6 (diff)
downloadchromium_src-8b4755fa086ef5d41e6a6ed40a38ac45390b9511.zip
chromium_src-8b4755fa086ef5d41e6a6ed40a38ac45390b9511.tar.gz
chromium_src-8b4755fa086ef5d41e6a6ed40a38ac45390b9511.tar.bz2
Enable the invalidating Core Animation plugin drawing model on 10.5
This also adds a layer of abstraction between the concept of the accelerated surface, and our cross-process implementation (which is something we needed to fix in general, but was necessary here to avoid bleeding TransportDIB references into code that's not supposed to know about process separation). There's no in-process implementation since we don't support in-process plugins on the Mac, but the abstraction is now there if we want to add one in the future. BUG=32012 TEST=Plugins using invalidating Core Animation model should run on 10.5 Review URL: http://codereview.chromium.org/3449023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61199 0039d316-1c4b-4281-b951-d872f2087c98
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