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 |
} |
+ |