diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 21 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 7 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 41 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.h | 7 |
4 files changed, 71 insertions, 5 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 2398d4c..17161e9 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -4531,6 +4531,27 @@ void RenderView::GPUPluginSetIOSurface(gfx::PluginWindowHandle window, routing_id(), window, width, height, io_surface_identifier)); } +void RenderView::GPUPluginSetTransportDIB(gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib) { + Send(new ViewHostMsg_GPUPluginSetTransportDIB( + routing_id(), window, width, height, transport_dib)); +} + +TransportDIB::Handle RenderView::GPUPluginAllocTransportDIB(size_t size) { + TransportDIB::Handle dib_handle; + // Assume this is a synchronous RPC. + if (Send(new ViewHostMsg_AllocTransportDIB(size, &dib_handle))) + return dib_handle; + // Return an invalid handle if Send() fails. + return TransportDIB::DefaultHandleValue(); +} + +void RenderView::GPUPluginFreeTransportDIB(TransportDIB::Id dib_id) { + Send(new ViewHostMsg_FreeTransportDIB(dib_id)); +} + void RenderView::GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) { Send(new ViewHostMsg_GPUPluginBuffersSwapped(routing_id(), window)); } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index b6be66c..85cd503 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -29,6 +29,7 @@ #include "chrome/common/page_zoom.h" #include "chrome/common/render_messages.h" #include "chrome/common/renderer_preferences.h" +#include "chrome/common/transport_dib.h" #include "chrome/common/view_types.h" #include "chrome/renderer/automation/dom_automation_controller.h" #include "chrome/renderer/dom_ui_bindings.h" @@ -472,6 +473,12 @@ class RenderView : public RenderWidget, int32 width, int32 height, uint64 io_surface_identifier); + TransportDIB::Handle GPUPluginAllocTransportDIB(size_t size); + void GPUPluginFreeTransportDIB(TransportDIB::Id dib_id); + void GPUPluginSetTransportDIB(gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); void GPUPluginBuffersSwapped(gfx::PluginWindowHandle window); #endif diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 178f07f..a743a3f 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -4,12 +4,12 @@ #include "chrome/renderer/webplugin_delegate_proxy.h" -#include <algorithm> - #if defined(OS_LINUX) #include <gtk/gtk.h> #endif +#include <algorithm> + #include "app/gfx/blit.h" #include "app/gfx/canvas.h" #include "app/gfx/native_widget_types.h" @@ -398,9 +398,16 @@ void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { #if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, OnUpdateGeometry_ACK) - // Used only on 10.6 and later + // Used only on 10.6 and later. IPC_MESSAGE_HANDLER(PluginHostMsg_GPUPluginSetIOSurface, OnGPUPluginSetIOSurface) + // Used on 10.5 and earlier. + IPC_MESSAGE_HANDLER(PluginHostMsg_GPUPluginSetTransportDIB, + OnGPUPluginSetTransportDIB) + IPC_MESSAGE_HANDLER(PluginHostMsg_AllocTransportDIB, + OnGPUPluginAllocTransportDIB) + IPC_MESSAGE_HANDLER(PluginHostMsg_FreeTransportDIB, + OnGPUPluginFreeTransportDIB) IPC_MESSAGE_HANDLER(PluginHostMsg_GPUPluginBuffersSwapped, OnGPUPluginBuffersSwapped) #endif @@ -503,8 +510,7 @@ void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect, // scripts the plugin to start playing while it's in the middle of handling // an update geometry message, videos don't play. See urls in bug 20260. msg = new PluginMsg_UpdateGeometrySync(instance_id_, param); - } - else + } else // NO_LINT #endif { msg = new PluginMsg_UpdateGeometry(instance_id_, param); @@ -1325,6 +1331,31 @@ void WebPluginDelegateProxy::OnGPUPluginSetIOSurface( io_surface_identifier); } +void WebPluginDelegateProxy::OnGPUPluginSetTransportDIB( + gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib) { + if (render_view_) + render_view_->GPUPluginSetTransportDIB(window, width, height, + transport_dib); +} + +void WebPluginDelegateProxy::OnGPUPluginAllocTransportDIB( + size_t size, + TransportDIB::Handle* dib_handle) { + if (render_view_) + *dib_handle = render_view_->GPUPluginAllocTransportDIB(size); + else + *dib_handle = TransportDIB::DefaultHandleValue(); +} + +void WebPluginDelegateProxy::OnGPUPluginFreeTransportDIB( + TransportDIB::Id dib_id) { + if (render_view_) + render_view_->GPUPluginFreeTransportDIB(dib_id); +} + void WebPluginDelegateProxy::OnGPUPluginBuffersSwapped( gfx::PluginWindowHandle window) { if (render_view_) diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index 98eb1ee..18d2704 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -152,6 +152,13 @@ class WebPluginDelegateProxy int32 width, int32 height, uint64 io_surface_identifier); + void OnGPUPluginSetTransportDIB(gfx::PluginWindowHandle window, + int32 width, + int32 height, + TransportDIB::Handle transport_dib); + void OnGPUPluginAllocTransportDIB(size_t size, + TransportDIB::Handle* dib_handle); + void OnGPUPluginFreeTransportDIB(TransportDIB::Id dib_id); void OnGPUPluginBuffersSwapped(gfx::PluginWindowHandle window); #endif |