Chromium Code Reviews| Index: ui/gl/gl_image_egl.cc |
| diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc |
| index 997ac7a0e742d2b7b04e618c761290adce423d21..14b5a626c4eeff9c24c1b2ecbeacac582ceb5fac 100644 |
| --- a/ui/gl/gl_image_egl.cc |
| +++ b/ui/gl/gl_image_egl.cc |
| @@ -22,17 +22,17 @@ GLImageEGL::~GLImageEGL() { |
| } |
| bool GLImageEGL::Initialize(gfx::GpuMemoryBufferHandle buffer) { |
| + buffer_ = buffer; |
| DCHECK(buffer.native_buffer); |
| EGLint attrs[] = { |
| EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, |
| EGL_NONE, |
| }; |
| - egl_image_ = eglCreateImageKHR( |
| - GLSurfaceEGL::GetHardwareDisplay(), |
| - EGL_NO_CONTEXT, |
| - EGL_NATIVE_BUFFER_ANDROID, |
| - buffer.native_buffer, |
| - attrs); |
| + egl_image_ = eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(), |
| + EGL_NO_CONTEXT, |
| + EGL_NATIVE_PIXMAP_KHR, |
|
rjkroege
2014/01/10 19:14:04
won't this change break something?
|
| + buffer.native_buffer, |
| + attrs); |
| if (egl_image_ == EGL_NO_IMAGE_KHR) { |
| EGLint error = eglGetError(); |
| @@ -80,8 +80,9 @@ bool GLImageEGL::BindTexImage(unsigned target) { |
| target_ = target; |
| // Defer ImageTargetTexture2D if not currently in use. |
| - if (!in_use_) |
| + /*if (!in_use_) { |
| return true; |
| + }*/ |
| glEGLImageTargetTexture2DOES(target_, egl_image_); |
| DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |
| @@ -94,16 +95,16 @@ void GLImageEGL::ReleaseTexImage(unsigned target) { |
| } |
| void GLImageEGL::WillUseTexImage() { |
| - DCHECK(egl_image_); |
| - DCHECK(!in_use_); |
| + /*DCHECK(egl_image_); |
|
rjkroege
2014/01/10 19:14:04
you've had to remove this because the surfaces in
|
| + //DCHECK(!in_use_); |
| in_use_ = true; |
| glEGLImageTargetTexture2DOES(target_, egl_image_); |
| - DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |
| + DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());*/ |
| } |
| void GLImageEGL::DidUseTexImage() { |
| - DCHECK(in_use_); |
| - in_use_ = false; |
| + // DCHECK(in_use_); |
| + /*in_use_ = false; |
| if (!release_after_use_) |
| return; |
| @@ -117,7 +118,7 @@ void GLImageEGL::DidUseTexImage() { |
| 0, |
| GL_RGBA, |
| GL_UNSIGNED_BYTE, |
| - &zero); |
| + &zero);*/ |
| } |
| void GLImageEGL::SetReleaseAfterUse() { |