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

Unified Diff: ui/gl/gl_image_x11.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
« no previous file with comments | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_x11.cc
diff --git a/ui/gl/gl_image_x11.cc b/ui/gl/gl_image_x11.cc
index 6f7d8c6e85b3c735d07c1d0feccbee89d5c458be..a46d02eb47b985a7512589ab2a2676ef2ebd9955 100644
--- a/ui/gl/gl_image_x11.cc
+++ b/ui/gl/gl_image_x11.cc
@@ -6,6 +6,7 @@
#include "base/debug/trace_event.h"
#include "ui/gl/gl_image_glx.h"
+#include "ui/gl/gl_image_linux_dma_buffer.h"
#include "ui/gl/gl_image_shm.h"
#include "ui/gl/gl_image_stub.h"
#include "ui/gl/gl_implementation.h"
@@ -40,9 +41,22 @@ scoped_refptr<GLImage> GLImage::CreateGLImageForGpuMemoryBuffer(
unsigned internalformat) {
TRACE_EVENT0("gpu", "GLImage::CreateGLImageForGpuMemoryBuffer");
switch (GetGLImplementation()) {
+ case kGLImplementationEGLGLES2:
+ switch (buffer.type) {
+ case INTEL_DRM_BUFFER: {
+ scoped_refptr<GLImageLinuxDMABuffer> image(
+ new GLImageLinuxDMABuffer(size, internalformat));
+ if (!image->Initialize(buffer))
+ return NULL;
+
+ return image;
+ }
+ default:
+ break;
+ }
+ // Fall-through.
case kGLImplementationOSMesaGL:
case kGLImplementationDesktopGL:
- case kGLImplementationEGLGLES2:
switch (buffer.type) {
case SHARED_MEMORY_BUFFER: {
scoped_refptr<GLImageShm> image(
« no previous file with comments | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698