Bug 822114 - Save and restore bound tex unit in DeleteTexture. r=bjacob, a=bajaj
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 18 Dec 2012 19:23:03 -0800
changeset 119048 54e4ebef9f6b5d8cff5cde16f5ff731bf76408d5
parent 119047 f29f629b3699f97478bf323569c6da99919f23e1
child 119049 f8b55879b2dec28cec0104887c6be2ea96293220
push id3049
push userryanvm@gmail.com
push dateSun, 23 Dec 2012 19:42:50 +0000
treeherdermozilla-aurora@8e0337f05bbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob, bajaj
bugs822114
milestone19.0a2
Bug 822114 - Save and restore bound tex unit in DeleteTexture. r=bjacob, a=bajaj
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -1059,25 +1059,26 @@ WebGLContext::DeleteTexture(WebGLTexture
         return;
 
     if (!tex || tex->IsDeleted())
         return;
 
     if (mBoundFramebuffer)
         mBoundFramebuffer->DetachTexture(tex);
 
+    WebGLuint activeTexture = mActiveTexture;
     for (int32_t i = 0; i < mGLMaxTextureUnits; i++) {
         if ((tex->Target() == LOCAL_GL_TEXTURE_2D && mBound2DTextures[i] == tex) ||
             (tex->Target() == LOCAL_GL_TEXTURE_CUBE_MAP && mBoundCubeMapTextures[i] == tex))
         {
             ActiveTexture(LOCAL_GL_TEXTURE0 + i);
             BindTexture(tex->Target(), static_cast<WebGLTexture*>(nullptr));
         }
     }
-    ActiveTexture(LOCAL_GL_TEXTURE0 + mActiveTexture);
+    ActiveTexture(LOCAL_GL_TEXTURE0 + activeTexture);
 
     tex->RequestDelete();
 }
 
 void
 WebGLContext::DeleteProgram(WebGLProgram *prog)
 {
     if (!IsContextStable())