Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2189)

Unified Diff: content/renderer/webplugin_delegate_proxy.cc

Issue 8678037: Render Core Animation plugins through WebKit's compositor rather than (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/webplugin_delegate_proxy.cc
===================================================================
--- content/renderer/webplugin_delegate_proxy.cc (revision 111400)
+++ content/renderer/webplugin_delegate_proxy.cc (working copy)
@@ -169,6 +169,9 @@
: render_view_(render_view),
plugin_(NULL),
uses_shared_bitmaps_(false),
+#if defined(OS_MACOSX)
+ uses_compositor_(false),
+#endif
window_(gfx::kNullPluginWindow),
mime_type_(mime_type),
instance_id_(MSG_ROUTING_NONE),
@@ -435,6 +438,13 @@
OnAcceleratedSurfaceFreeTransportDIB)
IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
+ // Used only on 10.6 and later.
+ IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedPluginEnabledRendering,
+ OnAcceleratedPluginEnabledRendering)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedPluginAllocatedIOSurface,
+ OnAcceleratedPluginAllocatedIOSurface)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedPluginSwappedIOSurface,
+ OnAcceleratedPluginSwappedIOSurface)
#endif
IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse,
OnURLRedirectResponse)
@@ -1030,7 +1040,11 @@
#endif // OS_MACOSX
void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
+#if defined(OS_MACOSX)
+ uses_shared_bitmaps_ = !window && !uses_compositor_;
+#else
uses_shared_bitmaps_ = !window;
+#endif
window_ = window;
if (plugin_)
plugin_->SetWindow(window);
@@ -1386,6 +1400,24 @@
if (render_view_)
render_view_->AcceleratedSurfaceBuffersSwapped(window, surface_id);
}
+
+void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() {
+ uses_compositor_ = true;
+ OnSetWindow(NULL);
+}
+
+void WebPluginDelegateProxy::OnAcceleratedPluginAllocatedIOSurface(
+ int32 width,
+ int32 height,
+ uint32 surface_id) {
+ if (plugin_)
+ plugin_->AcceleratedPluginAllocatedIOSurface(width, height, surface_id);
+}
+
+void WebPluginDelegateProxy::OnAcceleratedPluginSwappedIOSurface() {
+ if (plugin_)
+ plugin_->AcceleratedPluginSwappedIOSurface();
+}
#endif
#if defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698