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..d402e7c0238c5d2799089ce7a2c63da0f36beb5d 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; |
@@ -170,8 +172,10 @@ void GLImageGLX::Destroy() { |
gfx::Size GLImageGLX::GetSize() { return size_; } |
bool GLImageGLX::BindTexImage(unsigned target) { |
- if (!glx_pixmap_) |
+ if (!glx_pixmap_) { |
+ DVLOG(0) << "No GLXPixMap to bind"; |
reveman
2014/07/24 16:22:03
"Uninitialized image cannot be bound to texture"
sohanjg
2014/07/25 10:54:21
Done.
|
return false; |
+ } |
// Requires TEXTURE_2D target. |
if (target != GL_TEXTURE_2D) |
@@ -182,7 +186,10 @@ bool GLImageGLX::BindTexImage(unsigned target) { |
} |
void GLImageGLX::ReleaseTexImage(unsigned target) { |
- DCHECK(glx_pixmap_); |
+ if (!glx_pixmap_) { |
+ DVLOG(0) << "No GLXPixMap to release"; |
reveman
2014/07/24 16:22:03
"Uninitialized image cannot be released from textu
sohanjg
2014/07/25 10:54:21
Done.
|
+ return false; |
+ } |
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), target); |
glXReleaseTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT); |