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

Unified Diff: ui/gl/gl_image_egl.cc

Issue 2449993005: Remove GLImage::Destroy(). (Closed)
Patch Set: One more Destroy() call on Mac. Created 4 years, 2 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_egl.h ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698