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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 19762004: Add multi-process GpuMemoryBuffer framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
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())

Powered by Google App Engine
This is Rietveld 408576698