summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/gpu_channel_host.cc
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-27 15:24:25 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-27 15:24:25 +0000
commitd8a58e44578fa646480cec37db3ddb40a5b673b7 (patch)
tree4221925985cab2e659d9b2a22434810361c1958a /chrome/renderer/gpu_channel_host.cc
parent5ba9c9ae342ff20bde44be9dfc538727d3696865 (diff)
downloadchromium_src-d8a58e44578fa646480cec37db3ddb40a5b673b7.zip
chromium_src-d8a58e44578fa646480cec37db3ddb40a5b673b7.tar.gz
chromium_src-d8a58e44578fa646480cec37db3ddb40a5b673b7.tar.bz2
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
Diffstat (limited to 'chrome/renderer/gpu_channel_host.cc')
-rw-r--r--chrome/renderer/gpu_channel_host.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc
index 719e8bf..10b52ed 100644
--- a/chrome/renderer/gpu_channel_host.cc
+++ b/chrome/renderer/gpu_channel_host.cc
@@ -7,8 +7,10 @@
#include "chrome/common/child_process.h"
#include "chrome/common/gpu_create_command_buffer_config.h"
#include "chrome/common/gpu_messages.h"
+#include "chrome/common/render_messages.h"
#include "chrome/renderer/command_buffer_proxy.h"
#include "chrome/renderer/gpu_video_service_host.h"
+#include "chrome/renderer/render_thread.h"
GpuChannelHost::GpuChannelHost() : state_(kUnconnected) {
}
@@ -90,7 +92,6 @@ bool GpuChannelHost::Send(IPC::Message* message) {
}
CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(
- gfx::NativeViewId view,
int render_view_id,
const std::string& allowed_extensions,
const std::vector<int32>& attribs) {
@@ -101,10 +102,8 @@ CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(
GPUCreateCommandBufferConfig init_params(allowed_extensions, attribs);
int32 route_id;
- if (!Send(new GpuChannelMsg_CreateViewCommandBuffer(view,
- render_view_id,
- init_params,
- &route_id))) {
+ if (!RenderThread::current()->Send(new ViewHostMsg_CreateViewCommandBuffer(
+ render_view_id, init_params, &route_id))) {
return NULL;
}