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

Unified Diff: ui/gl/gl_image_glx.cc

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve android clang dbg build issue. Created 6 years, 5 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_glx.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_glx.cc
diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
index 61bd0971d00599d87b34bb5cd876d40ad89b7edd..3b9eb106cbc22a9b8fd02a7a0a02d71329e17110 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -111,7 +111,9 @@ GLImageGLX::GLImageGLX(const gfx::Size& size, unsigned internalformat)
: glx_pixmap_(0), size_(size), internalformat_(internalformat) {
}
-GLImageGLX::~GLImageGLX() { Destroy(); }
+GLImageGLX::~GLImageGLX() {
+ DCHECK_EQ(0u, glx_pixmap_);
+}
bool GLImageGLX::Initialize(XID pixmap) {
if (!GLSurfaceGLX::IsTextureFromPixmapSupported()) {
@@ -160,7 +162,7 @@ bool GLImageGLX::Initialize(XID pixmap) {
return true;
}
-void GLImageGLX::Destroy() {
+void GLImageGLX::Destroy(bool have_context) {
if (glx_pixmap_) {
glXDestroyGLXPixmap(gfx::GetXDisplay(), glx_pixmap_);
glx_pixmap_ = 0;
@@ -182,7 +184,7 @@ bool GLImageGLX::BindTexImage(unsigned target) {
}
void GLImageGLX::ReleaseTexImage(unsigned target) {
- DCHECK(glx_pixmap_);
+ DCHECK_NE(0u, glx_pixmap_);
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), target);
glXReleaseTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT);
« no previous file with comments | « ui/gl/gl_image_glx.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698