From d8a58e44578fa646480cec37db3ddb40a5b673b7 Mon Sep 17 00:00:00 2001 From: "backer@chromium.org" Date: Thu, 27 Jan 2011 15:24:25 +0000 Subject: Route IPC through browser when creating a viewable command buffer. The communications path for creating a viewable command buffer used to be directly from the renderer (gpu_channel.cc) to the gpu process (gpu_channel.cc). This patch makes the browser an intermediary: - renderer (gpu_channel.cc) makes a synchronous request to the browser (picked up in renderer_message_filter.cc and forwarded to gpu_process_host.cc) - browser (gpu_process_host.cc) makes an asynchronous request to the gpu process (picked up in gpu_thread.cc and forwarded to gpu_channel.cc) for the command buffer - gpu process (gpu_thread.cc) sends an ACK with the route_id for the command buffer back to the browser (gpu_process_host.cc) - browser (gpu_process_host.cc) sends a delayed reply back to the renderer (gpu_channel_host.cc), which had blocked There are several motivations for this patch: - creating an onscreen command buffer requires a window to draw into (which is acquired/locked in the browser); by routing through the browser, we can acquire the get the window beforehand (thereby preventing a deadlock in some other work that I'm doing) - we can eliminate several separate synchronous IPC messages for obtaining and releasing the window associated with drawing (I've tried to unify the different code paths for Linux, Windows, and Mac) - in the future, we can have the browser allocate SHM for the command buffer and transfer buffers, allowing us to sandbox the gpu process BUG=none TEST=by hand on all 3 platforms, trybots Review URL: http://codereview.chromium.org/6343006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72798 0039d316-1c4b-4281-b951-d872f2087c98 --- .../webgraphicscontext3d_command_buffer_impl.cc | 26 +--------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc') diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc index 1d8e5d6..0e97b94 100644 --- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc +++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc @@ -27,9 +27,6 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl() : context_(NULL), web_view_(NULL), -#if defined(OS_MACOSX) - plugin_handle_(NULL), -#endif // defined(OS_MACOSX) cached_width_(0), cached_height_(0), bound_fbo_(0) { @@ -37,19 +34,6 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl() WebGraphicsContext3DCommandBufferImpl:: ~WebGraphicsContext3DCommandBufferImpl() { -#if defined(OS_MACOSX) - if (web_view_) { - DCHECK(plugin_handle_ != gfx::kNullPluginWindow); - RenderView* renderview = RenderView::FromWebView(web_view_); - // The RenderView might already have been freed, but in its - // destructor it destroys all fake plugin window handles it - // allocated. - if (renderview) { - renderview->DestroyFakePluginWindowHandle(plugin_handle_); - } - plugin_handle_ = gfx::kNullPluginWindow; - } -#endif if (context_) { ggl::DestroyContext(context_); } @@ -101,18 +85,10 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize( RenderView* renderview = RenderView::FromWebView(web_view); if (!renderview) return false; - gfx::NativeViewId view_id; -#if !defined(OS_MACOSX) - view_id = renderview->host_window(); -#else - plugin_handle_ = renderview->AllocateFakePluginWindowHandle( - /*opaque=*/true, /*root=*/true); - view_id = static_cast(plugin_handle_); -#endif + web_view_ = web_view; context_ = ggl::CreateViewContext( host, - view_id, renderview->routing_id(), kWebGraphicsContext3DPerferredGLExtensions, attribs); -- cgit v1.1