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

Unified Diff: ui/gl/gl_image_android.cc

Issue 13543007: GLImage support for Android zero-copy pixel buffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix minor indentation issue Created 7 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/gl/gl_image.h ('k') | ui/gl/gl_image_egl.h » ('j') | ui/gl/gl_image_egl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_android.cc
diff --git a/ui/gl/gl_image_android.cc b/ui/gl/gl_image_android.cc
index e55e3bbd6890e3078d8003c94940114fbbdcc724..20448db98991a399d5dd8a72545c575f37087676 100644
--- a/ui/gl/gl_image_android.cc
+++ b/ui/gl/gl_image_android.cc
@@ -5,6 +5,7 @@
#include "ui/gl/gl_image.h"
#include "base/debug/trace_event.h"
+#include "ui/gl/gl_image_egl.h"
#include "ui/gl/gl_image_stub.h"
#include "ui/gl/gl_implementation.h"
@@ -13,9 +14,26 @@ namespace gfx {
scoped_refptr<GLImage> GLImage::CreateGLImage(gfx::PluginWindowHandle window) {
TRACE_EVENT0("gpu", "GLImage::CreateGLImage");
switch (GetGLImplementation()) {
- case kGLImplementationEGLGLES2: {
+ case kGLImplementationEGLGLES2:
return NULL;
- }
+ case kGLImplementationMockGL:
+ return new GLImageStub;
+ default:
+ NOTREACHED();
+ return NULL;
+ }
+}
+
+scoped_refptr<GLImage> GLImage::CreateGLImageForGpuMemoryBuffer(
+ gfx::GpuMemoryBufferHandle buffer, const gfx::Size& size) {
+ TRACE_EVENT0("gpu", "GLImage::CreateGLImageForGpuMemoryBuffer");
+ switch (GetGLImplementation()) {
+ case kGLImplementationEGLGLES2:
+ scoped_refptr<GLImageEGL> image(new GLImageEGL(size));
+ if (!image->Initialize(buffer))
+ return NULL;
+
+ return image;
case kGLImplementationMockGL:
return new GLImageStub;
default:
« no previous file with comments | « ui/gl/gl_image.h ('k') | ui/gl/gl_image_egl.h » ('j') | ui/gl/gl_image_egl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698