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

Unified Diff: content/browser/renderer_host/render_message_filter.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
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/child_process_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index d7e32d080be9861eab46cb951eeeef986053410a..7fd1870b1ac15ff53ed069d7b05f2ec35e1ee05e 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -398,6 +398,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
OnAllocateSharedMemory)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer,
+ OnAllocateGpuMemoryBuffer)
#if defined(OS_POSIX) && !defined(TOOLKIT_GTK) && !defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB)
IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB)
@@ -1165,4 +1167,23 @@ void RenderMessageFilter::OnWebAudioMediaCodec(
true);
}
#endif
+
+void RenderMessageFilter::OnAllocateGpuMemoryBuffer(
+ uint32 buffer_size,
+ gfx::GpuMemoryBufferHandle* handle) {
+ // TODO(reveman): Implement allocation of real GpuMemoryBuffer.
+ // Currently this function creates a fake GpuMemoryBuffer that is
+ // backed by shared memory and requires an upload before it can
+ // be used as a texture. The plan is to instead have this function
+ // allocate a real GpuMemoryBuffer in whatever form is supported
+ // by platform and drivers.
+ //
+ // Note: |buffer_size| likely needs to be replaced by a more
+ // specific buffer description but is enough for the shared memory
+ // backed GpuMemoryBuffer currently returned.
+ handle->type = gfx::SHARED_MEMORY_BUFFER;
+ ChildProcessHostImpl::AllocateSharedMemory(
+ buffer_size, PeerHandle(), &handle->handle);
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/child_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698