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

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: WIP - review comments addressed. Created 6 years, 7 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
Index: ui/gl/gl_image_glx.cc
diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
index 4b7e883781cd8160e6bc6c49d38be238088fc6bd..d49ca8f49133429a0b0c5b624269892e7447240b 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -49,7 +49,10 @@ GLImageGLX::GLImageGLX(gfx::PluginWindowHandle window)
pixmap_(0),
glx_pixmap_(0) {}
-GLImageGLX::~GLImageGLX() { Destroy(); }
+GLImageGLX::~GLImageGLX() {
+ DCHECK_EQ(0u, glx_pixmap_);
+ DCHECK_EQ(0u, pixmap_);
+}
bool GLImageGLX::Initialize() {
if (!GLSurfaceGLX::IsTextureFromPixmapSupported()) {
@@ -98,6 +101,10 @@ bool GLImageGLX::Initialize() {
// Create backing pixmap reference.
pixmap_ = XCompositeNameWindowPixmap(display_, window_);
+ if (!pixmap_) {
+ LOG(ERROR) << "XCompositeNameWindowPixmap failed.";
+ return false;
+ }
reveman 2014/06/02 14:34:47 This doesn't help in any way as XCompositeNameWind
sohanjg 2014/06/02 15:39:10 Done.
XID root = 0;
int x = 0;
@@ -126,7 +133,7 @@ bool GLImageGLX::Initialize() {
return true;
}
-void GLImageGLX::Destroy() {
+void GLImageGLX::Destroy(bool have_context) {
if (glx_pixmap_) {
glXDestroyGLXPixmap(display_, glx_pixmap_);
glx_pixmap_ = 0;

Powered by Google App Engine
This is Rietveld 408576698