Commit 40757b28 by Michael Spang Committed by Commit Bot

Use ConvertToGLBoolean instead of ternary operator in Context

Clean up Context by replacing foo ? GL_TRUE : GL_FALSE by ConvertToGLBoolean(foo); Change-Id: I6a6ee9c23bb30d8b4ef43371c04a94578758145e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1626309Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
parent de15ed37
......@@ -1343,7 +1343,7 @@ void Context::getBooleanvImpl(GLenum pname, GLboolean *params)
*params = GL_TRUE;
break;
case GL_CONTEXT_ROBUST_ACCESS_EXT:
*params = mRobustAccess ? GL_TRUE : GL_FALSE;
*params = ConvertToGLBoolean(mRobustAccess);
break;
default:
......@@ -5862,7 +5862,7 @@ GLboolean Context::isBuffer(GLuint buffer)
return GL_FALSE;
}
return (getBuffer(buffer) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getBuffer(buffer));
}
GLboolean Context::isEnabled(GLenum cap)
......@@ -5877,7 +5877,7 @@ GLboolean Context::isFramebuffer(GLuint framebuffer)
return GL_FALSE;
}
return (getFramebuffer(framebuffer) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getFramebuffer(framebuffer));
}
GLboolean Context::isProgram(GLuint program)
......@@ -5887,7 +5887,7 @@ GLboolean Context::isProgram(GLuint program)
return GL_FALSE;
}
return (getProgramNoResolveLink(program) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getProgramNoResolveLink(program));
}
GLboolean Context::isRenderbuffer(GLuint renderbuffer)
......@@ -5897,7 +5897,7 @@ GLboolean Context::isRenderbuffer(GLuint renderbuffer)
return GL_FALSE;
}
return (getRenderbuffer(renderbuffer) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getRenderbuffer(renderbuffer));
}
GLboolean Context::isShader(GLuint shader)
......@@ -5907,7 +5907,7 @@ GLboolean Context::isShader(GLuint shader)
return GL_FALSE;
}
return (getShader(shader) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getShader(shader));
}
GLboolean Context::isTexture(GLuint texture)
......@@ -5917,7 +5917,7 @@ GLboolean Context::isTexture(GLuint texture)
return GL_FALSE;
}
return (getTexture(texture) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getTexture(texture));
}
void Context::linkProgram(GLuint program)
......@@ -6249,7 +6249,7 @@ void Context::deleteQueries(GLsizei n, const GLuint *ids)
GLboolean Context::isQuery(GLuint id)
{
return (getQuery(id, false, QueryType::InvalidEnum) != nullptr) ? GL_TRUE : GL_FALSE;
return ConvertToGLBoolean(getQuery(id, false, QueryType::InvalidEnum) != nullptr);
}
void Context::uniformMatrix2x3fv(GLint location,
......@@ -6347,7 +6347,7 @@ bool Context::isVertexArray(GLuint array)
}
VertexArray *vao = getVertexArray(array);
return (vao != nullptr ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(vao != nullptr);
}
void Context::endTransformFeedback()
......@@ -6424,7 +6424,7 @@ bool Context::isTransformFeedback(GLuint id)
}
const TransformFeedback *transformFeedback = getTransformFeedback(id);
return ((transformFeedback != nullptr) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(transformFeedback != nullptr);
}
void Context::pauseTransformFeedback()
......@@ -6963,7 +6963,7 @@ GLboolean Context::isProgramPipeline(GLuint pipeline)
return GL_FALSE;
}
return (getProgramPipeline(pipeline) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getProgramPipeline(pipeline));
}
void Context::finishFenceNV(GLuint fence)
......@@ -7128,7 +7128,7 @@ GLboolean Context::isMemoryObject(GLuint memoryObject)
return GL_FALSE;
}
return (getMemoryObject(memoryObject) ? GL_TRUE : GL_FALSE);
return ConvertToGLBoolean(getMemoryObject(memoryObject));
}
void Context::createMemoryObjects(GLsizei n, GLuint *memoryObjects)
......
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