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

Unified Diff: chrome/renderer/webplugin_delegate_proxy.cc

Issue 558035: [GPU] Get GPU process running on the mac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months 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
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.h ('k') | gpu/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webplugin_delegate_proxy.cc
===================================================================
--- chrome/renderer/webplugin_delegate_proxy.cc (revision 37920)
+++ chrome/renderer/webplugin_delegate_proxy.cc (working copy)
@@ -386,6 +386,11 @@
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK,
OnUpdateGeometry_ACK)
+ // Used only on 10.6 and later
+ IPC_MESSAGE_HANDLER(PluginHostMsg_GPUPluginSetIOSurface,
+ OnGPUPluginSetIOSurface)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_GPUPluginBuffersSwapped,
+ OnGPUPluginBuffersSwapped)
#endif
IPC_MESSAGE_UNHANDLED_ERROR()
@@ -891,6 +896,14 @@
void WebPluginDelegateProxy::WillDestroyWindow() {
DCHECK(window_);
plugin_->WillDestroyWindow(window_);
+#if defined(OS_MACOSX)
+ if (window_) {
+ // This is actually a "fake" window handle only for the GPU
+ // plugin. Deallocate it on the browser side.
+ if (render_view_)
+ render_view_->DestroyFakePluginWindowHandle(window_);
+ }
+#endif
window_ = gfx::kNullPluginWindow;
}
@@ -1199,6 +1212,23 @@
CommandBufferProxy* WebPluginDelegateProxy::CreateCommandBuffer() {
#if defined(ENABLE_GPU)
+#if defined(OS_MACOSX)
+ // We need to synthesize a fake window handle for this nested
+ // delegate to identify the instance of the GPU plugin back to the
+ // browser.
+ gfx::PluginWindowHandle fake_window = NULL;
+ if (render_view_)
+ fake_window = render_view_->AllocateFakePluginWindowHandle();
+ // If we aren't running on 10.6, this allocation will fail.
+ if (!fake_window)
+ return NULL;
+ OnSetWindow(fake_window);
+ if (!Send(new PluginMsg_SetFakeGPUPluginWindowHandle(instance_id_,
+ fake_window))) {
+ return NULL;
+ }
+#endif
+
int command_buffer_id;
if (!Send(new PluginMsg_CreateCommandBuffer(instance_id_,
&command_buffer_id))) {
@@ -1247,4 +1277,20 @@
old_transport_dibs_.erase(iterator);
}
+
+void WebPluginDelegateProxy::OnGPUPluginSetIOSurface(
+ gfx::PluginWindowHandle window,
+ int32 width,
+ int32 height,
+ uint64 io_surface_identifier) {
+ if (render_view_)
+ render_view_->GPUPluginSetIOSurface(window, width, height,
+ io_surface_identifier);
+}
+
+void WebPluginDelegateProxy::OnGPUPluginBuffersSwapped(
+ gfx::PluginWindowHandle window) {
+ if (render_view_)
+ render_view_->GPUPluginBuffersSwapped(window);
+}
#endif
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.h ('k') | gpu/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698