Index: ui/gl/gl_image_ozone.cc |
diff --git a/ui/gl/gl_image_ozone.cc b/ui/gl/gl_image_ozone.cc |
index a1c13296aae350753acdf900fd529e583276d5fe..b0793c13ac9eb2a320df853ad3ad4f4f5ef421c1 100644 |
--- a/ui/gl/gl_image_ozone.cc |
+++ b/ui/gl/gl_image_ozone.cc |
@@ -5,6 +5,7 @@ |
#include "ui/gl/gl_image.h" |
#include "base/debug/trace_event.h" |
+#include "ui/gfx/ozone/surface_factory_ozone.h" |
#include "ui/gl/gl_image_egl.h" |
#include "ui/gl/gl_image_stub.h" |
#include "ui/gl/gl_implementation.h" |
@@ -31,11 +32,20 @@ scoped_refptr<GLImage> GLImage::CreateGLImageForGpuMemoryBuffer( |
gfx::Size size, |
unsigned internalformat) { |
TRACE_EVENT0("gpu", "GLImage::CreateGLImageForGpuMemoryBuffer"); |
+ |
+ buffer.native_buffer = reinterpret_cast<void*>( |
+ gfx::SurfaceFactoryOzone::GetInstance()->CreateNativeBuffer( |
+ size, internalformat)); |
+ |
switch (GetGLImplementation()) { |
case kGLImplementationOSMesaGL: |
- return NULL; |
- case kGLImplementationEGLGLES2: |
- return NULL; |
+ case kGLImplementationEGLGLES2: { |
+ scoped_refptr<GLImageEGL> image(new GLImageEGL(size)); |
+ if (!image->Initialize(buffer)) |
+ return NULL; |
+ |
+ return image; |
+ } |
case kGLImplementationMockGL: |
return new GLImageStub; |
default: |