Bug 1313541 - ClearBuffer style fixes. - r=ethlin

MozReview-Commit-ID: CZbWDAepxlX
This commit is contained in:
Jeff Gilbert (:jgilbert) 2016-10-13 16:25:11 -07:00
Родитель ec29704197
Коммит da6363d868
1 изменённых файлов: 15 добавлений и 12 удалений

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

@ -10,28 +10,30 @@
namespace mozilla {
bool WebGL2Context::ValidateClearBuffer(const char* info, GLenum buffer, GLint drawbuffer, size_t elemCount)
bool
WebGL2Context::ValidateClearBuffer(const char* info, GLenum buffer, GLint drawbuffer,
size_t elemCount)
{
size_t requiredElements = -1;
GLint maxDrawbuffer = -1;
size_t requiredElements;
GLint maxDrawbuffer;
switch (buffer) {
case LOCAL_GL_COLOR:
case LOCAL_GL_FRONT:
case LOCAL_GL_BACK:
case LOCAL_GL_LEFT:
case LOCAL_GL_RIGHT:
case LOCAL_GL_FRONT_AND_BACK:
case LOCAL_GL_COLOR:
case LOCAL_GL_FRONT:
case LOCAL_GL_BACK:
case LOCAL_GL_LEFT:
case LOCAL_GL_RIGHT:
case LOCAL_GL_FRONT_AND_BACK:
requiredElements = 4;
maxDrawbuffer = mGLMaxDrawBuffers - 1;
break;
case LOCAL_GL_DEPTH:
case LOCAL_GL_STENCIL:
case LOCAL_GL_DEPTH:
case LOCAL_GL_STENCIL:
requiredElements = 1;
maxDrawbuffer = 0;
break;
default:
default:
ErrorInvalidEnumInfo(info, buffer);
return false;
}
@ -47,6 +49,7 @@ bool WebGL2Context::ValidateClearBuffer(const char* info, GLenum buffer, GLint d
info, requiredElements, elemCount);
return false;
}
return true;
}