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

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

Issue 225023009: Add Intel DRM backed GpuMemoryBuffer implementation. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and add gl implementation checks Created 6 years, 8 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/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 e5492e1cd8c24e976abff15c8b0b3b187b53f47d..5d9cd920954ba2f18f18503f14d6f67cd1d577a2 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -91,6 +91,10 @@
#include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h"
#include "media/base/android/webaudio_media_codec_bridge.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
using net::CookieStore;
@@ -1260,6 +1264,23 @@ void RenderMessageFilter::OnAllocateGpuMemoryBuffer(
return;
}
+#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 (is_gl_implementation_supported_by_intel_drm &&
+ GpuMemoryBufferImplIntelDRM::IsFormatSupported(internalformat)) {
+ if (GpuMemoryBufferImplIntelDRM::AllocateBufferObject(
+ gfx::Size(width, height), internalformat, &handle->handle)) {
+ handle->type = gfx::INTEL_DRM_BUFFER;
+ return;
+ }
+ }
+#endif
+
#if defined(OS_MACOSX)
if (GpuMemoryBufferImplIOSurface::IsFormatSupported(internalformat)) {
IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize();
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698