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..181999997ea4cdfd484704ad7b6e0caf27ecd131 100644 |
--- a/ui/gl/gl_image_egl.cc |
+++ b/ui/gl/gl_image_egl.cc |
@@ -14,7 +14,14 @@ 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(); |
+ } |
+ } |
} |
bool GLImageEGL::Initialize(EGLenum target, |
@@ -32,19 +39,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_; |
} |