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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 288343004: working copy of "zero_copy" Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 years, 6 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/gpu/dri_buffer_manager.cc ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
===================================================================
--- content/browser/renderer_host/render_process_host_impl.cc (revision 277402)
+++ content/browser/renderer_host/render_process_host_impl.cc (working copy)
@@ -177,6 +177,10 @@
#include "content/common/media/media_stream_messages.h"
#endif
+#if defined(OS_LINUX)
+#include "content/browser/gpu/dri_buffer_manager.h"
+#endif
+
extern bool g_exited_main_message_loop;
static const char* kSiteProcessMapKeyName = "content_site_process_map";
@@ -2287,6 +2291,26 @@
}
#endif
+#if defined(OS_LINUX)
+ gfx::GpuMemoryBufferHandle handle;
+
+ uint64 stride = static_cast<uint64>(width) *
+ GpuMemoryBufferImpl::BytesPerPixel(internalformat);
+ if (stride > std::numeric_limits<uint32>::max()) {
+ handle.type = gfx::EMPTY_BUFFER;
+ GpuMemoryBufferAllocated(reply, handle);
+ return;
+ }
+ //if (!buffer_manager_)
+ //buffer_manager_ = new DRIBufferManager();
+ handle.type = gfx::DMA_BUFFER;
+ DRIBufferManager::CreateBuffer(width, height, handle);
+ if (handle.handle.fd > 0 && handle.card_handle.fd > 0) {
+ GpuMemoryBufferAllocated(reply, handle);
+ return;
+ }
+#endif
+
GpuMemoryBufferImpl::AllocateForChildProcess(
gfx::Size(width, height),
internalformat,
« no previous file with comments | « content/browser/gpu/dri_buffer_manager.cc ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698