Bug 698088 - Rebind previous state after initializing fake-black textures - r=bjacob

This commit is contained in:
Jeff Gilbert 2011-10-31 16:55:01 -07:00
parent 5b4030b08d
commit 4f29336b92
4 changed files with 8 additions and 9 deletions

View File

@ -1534,6 +1534,11 @@ WebGLContext::BindFakeBlackTextures()
return;
if (!mBlackTexturesAreInitialized) {
GLuint bound2DTex = 0;
GLuint boundCubeTex = 0;
gl->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, (GLint*) &bound2DTex);
gl->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_CUBE_MAP, (GLint*) &boundCubeTex);
const PRUint8 black[] = {0, 0, 0, 255};
gl->fGenTextures(1, &mBlackTexture2D);
@ -1548,9 +1553,9 @@ WebGLContext::BindFakeBlackTextures()
0, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, &black);
}
// return the texture bindings to the 0 texture to prevent the user from modifying our black textures
gl->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
gl->fBindTexture(LOCAL_GL_TEXTURE_CUBE_MAP, 0);
// Reset bound textures
gl->fBindTexture(LOCAL_GL_TEXTURE_2D, bound2DTex);
gl->fBindTexture(LOCAL_GL_TEXTURE_CUBE_MAP, boundCubeTex);
mBlackTexturesAreInitialized = true;
}

View File

@ -8,6 +8,4 @@ conformance/renderbuffers/framebuffer-object-attachment.html
conformance/textures/texture-mips.html
conformance/uniforms/gl-uniform-bool.html
conformance/more/conformance/quickCheckAPI-S_V.html
conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/uniformfArrayLen1.html

View File

@ -11,7 +11,5 @@ conformance/textures/tex-input-validation.html
conformance/textures/texture-mips.html
conformance/textures/texture-npot.html
conformance/more/conformance/quickCheckAPI-S_V.html
conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/uniformfBadArgs.html
conformance/more/functions/uniformiBadArgs.html

View File

@ -7,6 +7,4 @@ conformance/glsl/misc/shader-with-256-character-identifier.frag.html
conformance/glsl/misc/shader-with-long-line.html
conformance/renderbuffers/framebuffer-object-attachment.html
conformance/more/conformance/quickCheckAPI-S_V.html
conformance/more/functions/copyTexImage2D.html
conformance/more/functions/copyTexSubImage2D.html
conformance/more/functions/uniformfArrayLen1.html