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 a13214db06d597f7a9375c09d971c95d72ad734d..397397b4992519ac66ec2cbc0e8f49b481652f07 100644 |
| --- a/ui/gl/gl_image_egl.cc |
| +++ b/ui/gl/gl_image_egl.cc |
| @@ -14,7 +14,15 @@ GLImageEGL::GLImageEGL(const gfx::Size& size) |
| GLImageEGL::~GLImageEGL() { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); |
| + if (egl_image_ != EGL_NO_IMAGE_KHR) { |
| + EGLBoolean result = |
| + eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); |
| + if (result == EGL_FALSE) { |
| + DLOG(ERROR) << "Error destroying EGLImage: " |
| + << ui::GetLastEGLErrorString(); |
| + } |
| + egl_image_ = EGL_NO_IMAGE_KHR; |
|
reveman
2016/10/27 20:01:44
nit: no need for this in dtor
sandersd (OOO until July 31)
2016/10/27 20:13:09
Done.
|
| + } |
| } |
| bool GLImageEGL::Initialize(EGLenum target, |
| @@ -32,19 +40,6 @@ bool GLImageEGL::Initialize(EGLenum target, |
| return true; |
| } |
| -void GLImageEGL::Destroy(bool have_context) { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - if (egl_image_ != EGL_NO_IMAGE_KHR) { |
| - EGLBoolean result = |
| - eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); |
| - if (result == EGL_FALSE) { |
| - DLOG(ERROR) << "Error destroying EGLImage: " |
| - << ui::GetLastEGLErrorString(); |
| - } |
| - egl_image_ = EGL_NO_IMAGE_KHR; |
| - } |
| -} |
| - |
| gfx::Size GLImageEGL::GetSize() { |
| return size_; |
| } |