Index: content/common/gpu/client/gpu_channel_host.cc |
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc |
index 27c71de98a1b28fbb555b72322237bbd4599a72b..aff2ba5768a29070e9bec13cd7408f7ac980c662 100644 |
--- a/content/common/gpu/client/gpu_channel_host.cc |
+++ b/content/common/gpu/client/gpu_channel_host.cc |
@@ -55,6 +55,7 @@ GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory, |
gpu_host_id_(gpu_host_id), |
gpu_info_(gpu_info) { |
next_transfer_buffer_id_.GetNext(); |
+ next_gpu_memory_buffer_id_.GetNext(); |
} |
void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle) { |
@@ -285,6 +286,25 @@ int32 GpuChannelHost::ReserveTransferBufferId() { |
return next_transfer_buffer_id_.GetNext(); |
} |
+gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess( |
+ gfx::GpuMemoryBufferHandle source_handle) { |
+ switch (source_handle.type) { |
+ case gfx::SHARED_MEMORY_BUFFER: { |
+ gfx::GpuMemoryBufferHandle handle; |
+ handle.type = gfx::SHARED_MEMORY_BUFFER; |
+ handle.handle = ShareToGpuProcess(source_handle.handle); |
+ return handle; |
+ } |
+ default: |
+ NOTREACHED(); |
+ return gfx::GpuMemoryBufferHandle(); |
+ } |
+} |
+ |
+int32 GpuChannelHost::ReserveGpuMemoryBufferId() { |
+ return next_gpu_memory_buffer_id_.GetNext(); |
+} |
+ |
GpuChannelHost::~GpuChannelHost() { |
// channel_ must be destroyed on the main thread. |
if (!factory_->IsMainThread()) |