Bug 922810 - Part 7: extend ScopedBindTexture to support cube maps - r=jgilbert

This commit is contained in:
Benoit Jacob 2013-10-11 09:16:43 -04:00
parent 4f7ecb11e8
commit 7ae9b37393

View File

@ -3579,13 +3579,13 @@ protected:
private:
void Init(GLenum target) {
MOZ_ASSERT(target == LOCAL_GL_TEXTURE_2D ||
target == LOCAL_GL_TEXTURE_RECTANGLE_ARB);
mTarget = target;
mOldTex = 0;
GLenum bindingTarget = (target == LOCAL_GL_TEXTURE_2D) ?
LOCAL_GL_TEXTURE_BINDING_2D :
LOCAL_GL_TEXTURE_BINDING_RECTANGLE_ARB;
GLenum bindingTarget = (target == LOCAL_GL_TEXTURE_2D) ? LOCAL_GL_TEXTURE_BINDING_2D
: (target == LOCAL_GL_TEXTURE_RECTANGLE_ARB) ? LOCAL_GL_TEXTURE_BINDING_RECTANGLE_ARB
: (target == LOCAL_GL_TEXTURE_CUBE_MAP) ? LOCAL_GL_TEXTURE_BINDING_CUBE_MAP
: LOCAL_GL_NONE;
MOZ_ASSERT(bindingTarget != LOCAL_GL_NONE);
mGL->GetUIntegerv(bindingTarget, &mOldTex);
}