Backed out changeset f08ab0578efb (bug 929506) for breaking GLContext during a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Thu, 21 Nov 2013 14:55:22 -0800
changeset 156953 c98ce04563fffa66a7469c1e98088c123ac3f54e
parent 156952 73aee4abf07bad0b448c5910f16a6803bce1ab1e
child 156954 7cfdbd447930fcaec00883d9d6867324f7c96cf0
push id36584
push userkwierso@gmail.com
push dateThu, 21 Nov 2013 22:55:41 +0000
treeherdermozilla-inbound@c98ce04563ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs929506
milestone28.0a1
backs outf08ab0578efb9643a39bdfcfbf9e0b387229d674
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset f08ab0578efb (bug 929506) for breaking GLContext during a CLOSED TREE
gfx/gl/GLTextureImage.cpp
--- a/gfx/gl/GLTextureImage.cpp
+++ b/gfx/gl/GLTextureImage.cpp
@@ -67,18 +67,19 @@ BasicTextureImage::~BasicTextureImage()
     if (ctx->IsDestroyed() || !ctx->IsOwningThreadCurrent()) {
         ctx = ctx->GetSharedContext();
     }
 
     // If we have a context, then we need to delete the texture;
     // if we don't have a context (either real or shared),
     // then they went away when the contex was deleted, because it
     // was the only one that had access to it.
-    if (ctx && ctx->MakeCurrent()) {
-        ctx->fDeleteTextures(1, &mTexture);
+    if (ctx && !ctx->IsDestroyed()) {
+        mGLContext->MakeCurrent();
+        mGLContext->fDeleteTextures(1, &mTexture);
     }
 }
 
 gfxASurface*
 BasicTextureImage::BeginUpdate(nsIntRegion& aRegion)
 {
     NS_ASSERTION(!mUpdateSurface, "BeginUpdate() without EndUpdate()?");
 
@@ -692,19 +693,17 @@ already_AddRefed<TextureImage>
 CreateBasicTextureImage(GLContext* aGL,
                         const nsIntSize& aSize,
                         TextureImage::ContentType aContentType,
                         GLenum aWrapMode,
                         TextureImage::Flags aFlags,
                         TextureImage::ImageFormat aImageFormat)
 {
     bool useNearestFilter = aFlags & TextureImage::UseNearestFilter;
-    if (!aGL->MakeCurrent()) {
-      return nullptr;
-    }
+    aGL->MakeCurrent();
 
     GLuint texture = 0;
     aGL->fGenTextures(1, &texture);
 
     ScopedBindTexture bind(aGL, texture);
 
     GLint texfilter = useNearestFilter ? LOCAL_GL_NEAREST : LOCAL_GL_LINEAR;
     aGL->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, texfilter);