Commit 96c2cabe authored by andreas.kling@nokia.com's avatar andreas.kling@nokia.com
Browse files

2010-09-10 Andreas Kling <andreas.kling@nokia.com>

        Reviewed by Antonio Gomes.

        WebGL: Fix GCC warnings about suggested parentheses around && within ||
        https://bugs.webkit.org/show_bug.cgi?id=45534

        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getVertexAttrib):
        (WebCore::WebGLRenderingContext::readPixels):
        (WebCore::WebGLRenderingContext::texParameter):
        (WebCore::WebGLRenderingContext::handleNPOTTextures):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 27eea63b
2010-09-10 Andreas Kling <andreas.kling@nokia.com>
Reviewed by Antonio Gomes.
WebGL: Fix GCC warnings about suggested parentheses around && within ||
https://bugs.webkit.org/show_bug.cgi?id=45534
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getVertexAttrib):
(WebCore::WebGLRenderingContext::readPixels):
(WebCore::WebGLRenderingContext::texParameter):
(WebCore::WebGLRenderingContext::handleNPOTTextures):
2010-09-09 Alexander Pavlov <apavlov@chromium.org>
 
Reviewed by Yury Semikhatsky.
......@@ -1756,7 +1756,7 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(unsigned long index, unsigne
}
switch (pname) {
case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
if (!isGLES2Compliant() && !index && m_vertexAttribState[0].bufferBinding == m_vertexAttrib0Buffer
if ((!isGLES2Compliant() && !index && m_vertexAttribState[0].bufferBinding == m_vertexAttrib0Buffer)
|| index >= m_vertexAttribState.size()
|| !m_vertexAttribState[index].bufferBinding
|| !m_vertexAttribState[index].bufferBinding->object())
......@@ -1943,8 +1943,8 @@ void WebGLRenderingContext::readPixels(long x, long y, long width, long height,
return;
}
// Validate array type against pixel type.
if (type == GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedByteArray()
|| type != GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedShortArray()) {
if ((type == GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedByteArray())
|| (type != GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedShortArray())) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2221,8 +2221,8 @@ void WebGLRenderingContext::texParameter(unsigned long target, unsigned long pna
break;
case GraphicsContext3D::TEXTURE_WRAP_S:
case GraphicsContext3D::TEXTURE_WRAP_T:
if (isFloat && paramf != GraphicsContext3D::CLAMP_TO_EDGE && paramf != GraphicsContext3D::MIRRORED_REPEAT && paramf != GraphicsContext3D::REPEAT
|| !isFloat && parami != GraphicsContext3D::CLAMP_TO_EDGE && parami != GraphicsContext3D::MIRRORED_REPEAT && parami != GraphicsContext3D::REPEAT) {
if ((isFloat && paramf != GraphicsContext3D::CLAMP_TO_EDGE && paramf != GraphicsContext3D::MIRRORED_REPEAT && paramf != GraphicsContext3D::REPEAT)
|| (!isFloat && parami != GraphicsContext3D::CLAMP_TO_EDGE && parami != GraphicsContext3D::MIRRORED_REPEAT && parami != GraphicsContext3D::REPEAT)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return;
}
......@@ -3012,8 +3012,8 @@ void WebGLRenderingContext::handleNPOTTextures(bool prepareToDraw)
{
bool resetActiveUnit = false;
for (unsigned ii = 0; ii < m_textureUnits.size(); ++ii) {
if (m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture()
|| m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture()) {
if ((m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture())
|| (m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture())) {
if (ii != m_activeTextureUnit) {
m_context->activeTexture(ii);
resetActiveUnit = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment