diff options
author | dspringer@google.com <dspringer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 18:00:07 +0000 |
---|---|---|
committer | dspringer@google.com <dspringer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 18:00:07 +0000 |
commit | 1aef9813f6edaead72c9dfe24ccd07ec525c75b3 (patch) | |
tree | 9cd13cab509d4e9d32d63b043a0c8132b7033cce /chrome/renderer/webplugin_delegate_proxy.cc | |
parent | bcc3a0cb7f900dda0b4065055f3539c01f901df2 (diff) | |
download | chromium_src-1aef9813f6edaead72c9dfe24ccd07ec525c75b3.zip chromium_src-1aef9813f6edaead72c9dfe24ccd07ec525c75b3.tar.gz chromium_src-1aef9813f6edaead72c9dfe24ccd07ec525c75b3.tar.bz2 |
Add 3D support for the Mac on Leopard (OS X 10.5) and earlier. This CL uses
FBO rendering with glGetTexImage() into a TransportDIB that is then used as
a texture for rendering the final image in the render view in the browser.
While not optimal, it works and can be optimized later, after the new GPU
process work is completed.
This CL also enables stencil buffer support on the Mac. All the Pepper3D
demos run on the Mac with these changes.
BUG=none
TEST=3D rendering unit tests.
Review URL: http://codereview.chromium.org/647043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 41 |
1 files changed, 36 insertions, 5 deletions
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_) |