Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index 11a629d413a2d457870f0914fce9372962cf5201..f3cfc1290e407f1b7b07d2efbad5eab84f736f4d 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -178,6 +178,11 @@ |
#include "content/common/media/media_stream_messages.h" |
#endif |
+#if defined(OS_LINUX) |
+#include "content/common/gpu/client/gpu_memory_buffer_impl_intel_drm.h" |
+#include "ui/gl/gl_implementation.h" |
+#endif |
+ |
extern bool g_exited_main_message_loop; |
static const char* kSiteProcessMapKeyName = "content_site_process_map"; |
@@ -2288,6 +2293,23 @@ void RenderProcessHostImpl::OnAllocateGpuMemoryBuffer(uint32 width, |
} |
#endif |
+#if defined(OS_LINUX) |
+ // Intel DRM implementation of gpu memory buffer is limited to EGLGLES2 as we |
+ // currently depend on EGL_EXT_image_dma_buf_import to use this type of buffer |
+ // on the GPU side. |
+ //bool is_gl_implementation_supported_by_intel_drm = |
+ // gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2; |
+ if (GpuMemoryBufferImplIntelDRM::IsFormatSupported(internalformat)) { |
+ gfx::GpuMemoryBufferHandle handle; |
+ if (GpuMemoryBufferImplIntelDRM::AllocateBufferObject( |
+ gfx::Size(width, height), internalformat, &handle.handle)) { |
+ handle.type = gfx::INTEL_DRM_BUFFER; |
+ GpuMemoryBufferAllocated(reply, handle); |
+ return; |
+ } |
+ } |
+#endif |
+ |
GpuMemoryBufferImpl::AllocateForChildProcess( |
gfx::Size(width, height), |
internalformat, |