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

Unified Diff: chrome/renderer/gpu_channel_host.cc

Issue 1136006: Calling OpenGL from the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/gpu_channel_host.h ('k') | chrome/renderer/render_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/gpu_channel_host.cc
===================================================================
--- chrome/renderer/gpu_channel_host.cc (revision 42644)
+++ chrome/renderer/gpu_channel_host.cc (working copy)
@@ -64,14 +64,15 @@
return channel_->Send(message);
}
-CommandBufferProxy* GpuChannelHost::CreateCommandBuffer() {
+CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(
+ gfx::NativeViewId view) {
#if defined(ENABLE_GPU)
// An error occurred. Need to get the host again to reinitialize it.
if (!channel_.get())
return NULL;
int32 route_id;
- if (!Send(new GpuChannelMsg_CreateCommandBuffer(&route_id)) &&
+ if (!Send(new GpuChannelMsg_CreateViewCommandBuffer(view, &route_id)) &&
route_id != MSG_ROUTING_NONE) {
return NULL;
}
@@ -85,6 +86,34 @@
#endif
}
+CommandBufferProxy* GpuChannelHost::CreateOffscreenCommandBuffer(
+ CommandBufferProxy* parent,
+ const gfx::Size& size,
+ uint32 parent_texture_id) {
+#if defined(ENABLE_GPU)
+ // An error occurred. Need to get the host again to reinitialize it.
+ if (!channel_.get())
+ return NULL;
+
+ int32 parent_route_id = parent ? parent->route_id() : 0;
+ int32 route_id;
+ if (!Send(new GpuChannelMsg_CreateOffscreenCommandBuffer(parent_route_id,
+ size,
+ parent_texture_id,
+ &route_id)) &&
+ route_id != MSG_ROUTING_NONE) {
+ return NULL;
+ }
+
+ CommandBufferProxy* command_buffer = new CommandBufferProxy(this, route_id);
+ router_.AddRoute(route_id, command_buffer);
+ proxies_[route_id] = command_buffer;
+ return command_buffer;
+#else
+ return NULL;
+#endif
+}
+
void GpuChannelHost::DestroyCommandBuffer(CommandBufferProxy* command_buffer) {
#if defined(ENABLE_GPU)
Send(new GpuChannelMsg_DestroyCommandBuffer(command_buffer->route_id()));
@@ -99,3 +128,4 @@
delete command_buffer;
#endif
}
+
« no previous file with comments | « chrome/renderer/gpu_channel_host.h ('k') | chrome/renderer/render_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698