Bug 743813 - Fix the warnings generated by WebGL activeTexture - r=jgilbert

This commit is contained in:
Benoit Jacob 2012-04-10 11:51:30 -04:00
Родитель d9adfa7a3f
Коммит 401a30de2c
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -134,9 +134,15 @@ WebGLContext::ActiveTexture(WebGLenum texture)
if (!IsContextStable())
return NS_OK;
if (texture < LOCAL_GL_TEXTURE0 || texture >= LOCAL_GL_TEXTURE0 + mBound2DTextures.Length())
return ErrorInvalidEnum("ActiveTexture: texture unit %d out of range (0..%d)",
texture, mBound2DTextures.Length()-1);
if (texture < LOCAL_GL_TEXTURE0 ||
texture >= LOCAL_GL_TEXTURE0 + mGLMaxTextureUnits)
{
return ErrorInvalidEnum(
"ActiveTexture: texture unit %d out of range. "
"Accepted values range from TEXTURE0 to TEXTURE0 + %d. "
"Notice that TEXTURE0 != 0.",
texture, mGLMaxTextureUnits);
}
MakeContextCurrent();
mActiveTexture = texture - LOCAL_GL_TEXTURE0;