Remove excess gl:: prefixing in validationES.cpp.
Refactor only.
Bug: angleproject:2747
Change-Id: I0ef7186daec54cd867ec2816f86f7205d836fd91
Reviewed-on: https://chromium-review.googlesource.com/1158609
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index d9e0dad..2b68e5b 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -83,7 +83,7 @@
{
ASSERT(context->getStateCache().hasAnyEnabledClientAttrib());
- const gl::State &state = context->getGLState();
+ const State &state = context->getGLState();
if (context->getExtensions().webglCompatibility || !state.areClientArraysEnabled())
{
@@ -773,7 +773,7 @@
UNREACHABLE();
}
- return level <= gl::log2(static_cast<int>(maxDimension)) && level >= 0;
+ return level <= log2(static_cast<int>(maxDimension)) && level >= 0;
}
bool ValidImageSizeParameters(Context *context,
@@ -794,7 +794,7 @@
bool hasNPOTSupport =
context->getExtensions().textureNPOT || context->getClientVersion() >= Version(3, 0);
if (!isSubImage && !hasNPOTSupport &&
- (level != 0 && (!gl::isPow2(width) || !gl::isPow2(height) || !gl::isPow2(depth))))
+ (level != 0 && (!isPow2(width) || !isPow2(height) || !isPow2(depth))))
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), TextureNotPow2);
return false;
@@ -821,7 +821,7 @@
GLsizei width,
GLsizei height)
{
- const gl::InternalFormat &formatInfo = gl::GetSizedInternalFormatInfo(internalFormat);
+ const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalFormat);
if (!formatInfo.compressed)
{
return false;
@@ -860,7 +860,7 @@
size_t textureWidth,
size_t textureHeight)
{
- const gl::InternalFormat &formatInfo = gl::GetSizedInternalFormatInfo(internalFormat);
+ const InternalFormat &formatInfo = GetSizedInternalFormatInfo(internalFormat);
if (!formatInfo.compressed)
{
return false;
@@ -905,8 +905,7 @@
const void *pixels,
GLsizei imageSize)
{
- gl::Buffer *pixelUnpackBuffer =
- context->getGLState().getTargetBuffer(BufferBinding::PixelUnpack);
+ Buffer *pixelUnpackBuffer = context->getGLState().getTargetBuffer(BufferBinding::PixelUnpack);
if (pixelUnpackBuffer == nullptr && imageSize < 0)
{
// Checks are not required
@@ -915,9 +914,9 @@
// ...the data would be unpacked from the buffer object such that the memory reads required
// would exceed the data store size.
- const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, type);
+ const InternalFormat &formatInfo = GetInternalFormatInfo(format, type);
ASSERT(formatInfo.internalFormat != GL_NONE);
- const gl::Extents size(width, height, depth);
+ const Extents size(width, height, depth);
const auto &unpack = context->getGLState().getUnpackState();
bool targetIs3D = texType == TextureType::_3D || texType == TextureType::_2DArray;
@@ -1079,7 +1078,7 @@
return validShader;
}
-bool ValidateAttachmentTarget(gl::Context *context, GLenum attachment)
+bool ValidateAttachmentTarget(Context *context, GLenum attachment)
{
if (attachment >= GL_COLOR_ATTACHMENT1_EXT && attachment <= GL_COLOR_ATTACHMENT15_EXT)
{
@@ -1159,7 +1158,7 @@
// ANGLE_framebuffer_multisample does not explicitly state that the internal format must be
// sized but it does state that the format must be in the ES2.0 spec table 4.5 which contains
// only sized internal formats.
- const gl::InternalFormat &formatInfo = gl::GetSizedInternalFormatInfo(convertedInternalFormat);
+ const InternalFormat &formatInfo = GetSizedInternalFormatInfo(convertedInternalFormat);
if (formatInfo.internalFormat == GL_NONE)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidRenderbufferInternalFormat);
@@ -1182,7 +1181,7 @@
return true;
}
-bool ValidateFramebufferRenderbufferParameters(gl::Context *context,
+bool ValidateFramebufferRenderbufferParameters(Context *context,
GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
@@ -1194,7 +1193,7 @@
return false;
}
- gl::Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
+ Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
ASSERT(framebuffer);
if (framebuffer->id() == 0)
@@ -1262,8 +1261,8 @@
}
const auto &glState = context->getGLState();
- gl::Framebuffer *readFramebuffer = glState.getReadFramebuffer();
- gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
+ Framebuffer *readFramebuffer = glState.getReadFramebuffer();
+ Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
if (!readFramebuffer || !drawFramebuffer)
{
@@ -1305,7 +1304,7 @@
if (mask & GL_COLOR_BUFFER_BIT)
{
- const gl::FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
+ const FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
const Extensions &extensions = context->getExtensions();
if (readColorBuffer)
@@ -1416,9 +1415,9 @@
{
if (mask & masks[i])
{
- const gl::FramebufferAttachment *readBuffer =
+ const FramebufferAttachment *readBuffer =
readFramebuffer->getAttachment(context, attachments[i]);
- const gl::FramebufferAttachment *drawBuffer =
+ const FramebufferAttachment *drawBuffer =
drawFramebuffer->getAttachment(context, attachments[i]);
if (readBuffer && drawBuffer)
@@ -1575,7 +1574,7 @@
return true;
}
-bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n, GLuint *ids)
+bool ValidateGenQueriesEXT(Context *context, GLsizei n, GLuint *ids)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery)
@@ -1587,7 +1586,7 @@
return ValidateGenOrDelete(context, n);
}
-bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n, const GLuint *ids)
+bool ValidateDeleteQueriesEXT(Context *context, GLsizei n, const GLuint *ids)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery)
@@ -1599,7 +1598,7 @@
return ValidateGenOrDelete(context, n);
}
-bool ValidateIsQueryEXT(gl::Context *context, GLuint id)
+bool ValidateIsQueryEXT(Context *context, GLuint id)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery)
@@ -1611,7 +1610,7 @@
return true;
}
-bool ValidateBeginQueryBase(gl::Context *context, QueryType target, GLuint id)
+bool ValidateBeginQueryBase(Context *context, QueryType target, GLuint id)
{
if (!ValidQueryType(context, target))
{
@@ -1666,7 +1665,7 @@
return true;
}
-bool ValidateBeginQueryEXT(gl::Context *context, QueryType target, GLuint id)
+bool ValidateBeginQueryEXT(Context *context, QueryType target, GLuint id)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
@@ -1678,7 +1677,7 @@
return ValidateBeginQueryBase(context, target, id);
}
-bool ValidateEndQueryBase(gl::Context *context, QueryType target)
+bool ValidateEndQueryBase(Context *context, QueryType target)
{
if (!ValidQueryType(context, target))
{
@@ -1697,7 +1696,7 @@
return true;
}
-bool ValidateEndQueryEXT(gl::Context *context, QueryType target)
+bool ValidateEndQueryEXT(Context *context, QueryType target)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
@@ -2047,7 +2046,7 @@
}
bool ValidateUniformCommonBase(Context *context,
- gl::Program *program,
+ Program *program,
GLint location,
GLsizei count,
const LinkedUniform **uniformOut)
@@ -2171,7 +2170,7 @@
bool ValidateUniform(Context *context, GLenum valueType, GLint location, GLsizei count)
{
const LinkedUniform *uniform = nullptr;
- gl::Program *programObject = context->getGLState().getProgram();
+ Program *programObject = context->getGLState().getProgram();
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniformValue(context, valueType, uniform->type);
}
@@ -2179,7 +2178,7 @@
bool ValidateUniform1iv(Context *context, GLint location, GLsizei count, const GLint *value)
{
const LinkedUniform *uniform = nullptr;
- gl::Program *programObject = context->getGLState().getProgram();
+ Program *programObject = context->getGLState().getProgram();
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniform1ivValue(context, uniform->type, count, value);
}
@@ -2197,7 +2196,7 @@
}
const LinkedUniform *uniform = nullptr;
- gl::Program *programObject = context->getGLState().getProgram();
+ Program *programObject = context->getGLState().getProgram();
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniformMatrixValue(context, valueType, uniform->type);
}
@@ -2442,7 +2441,7 @@
return false;
}
- const gl::State &state = context->getGLState();
+ const State &state = context->getGLState();
Framebuffer *readFramebuffer = state.getReadFramebuffer();
if (!ValidateFramebufferComplete(context, readFramebuffer))
{
@@ -2483,7 +2482,7 @@
return false;
}
- const gl::Caps &caps = context->getCaps();
+ const Caps &caps = context->getCaps();
GLuint maxDimension = 0;
switch (texType)
@@ -2513,7 +2512,7 @@
return false;
}
- gl::Texture *texture = state.getTargetTexture(texType);
+ Texture *texture = state.getTargetTexture(texType);
if (!texture)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), TextureNotBound);
@@ -2526,9 +2525,9 @@
return false;
}
- const gl::InternalFormat &formatInfo =
+ const InternalFormat &formatInfo =
isSubImage ? *texture->getFormat(target, level).info
- : gl::GetInternalFormatInfo(internalformat, GL_UNSIGNED_BYTE);
+ : GetInternalFormatInfo(internalformat, GL_UNSIGNED_BYTE);
if (formatInfo.depthBits > 0 || formatInfo.compressed)
{
@@ -2687,7 +2686,7 @@
// If we are running GLES1, there is no current program.
if (context->getClientVersion() >= Version(2, 0))
{
- gl::Program *program = state.getProgram();
+ Program *program = state.getProgram();
if (!program)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ProgramNotBound);
@@ -2764,8 +2763,7 @@
for (unsigned int uniformBlockIndex = 0;
uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++)
{
- const gl::InterfaceBlock &uniformBlock =
- program->getUniformBlockByIndex(uniformBlockIndex);
+ const InterfaceBlock &uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex);
GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex);
const OffsetBindingPointer<Buffer> &uniformBuffer =
state.getIndexedUniformBuffer(blockBinding);
@@ -2857,7 +2855,7 @@
}
const State &state = context->getGLState();
- gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
+ TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive() &&
!curTransformFeedback->isPaused())
{
@@ -2944,7 +2942,7 @@
const State &state = context->getGLState();
- gl::TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
+ TransformFeedback *curTransformFeedback = state.getCurrentTransformFeedback();
if (curTransformFeedback && curTransformFeedback->isActive() &&
!curTransformFeedback->isPaused())
{
@@ -2990,10 +2988,10 @@
return false;
}
- const gl::VertexArray *vao = state.getVertexArray();
- gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
+ const VertexArray *vao = state.getVertexArray();
+ Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
- GLuint typeBytes = gl::GetTypeInfo(type).bytes;
+ GLuint typeBytes = GetTypeInfo(type).bytes;
if (context->getExtensions().webglCompatibility)
{
@@ -3172,7 +3170,7 @@
if (texture != 0)
{
- gl::Texture *tex = context->getTexture(texture);
+ Texture *tex = context->getTexture(texture);
if (tex == nullptr)
{
@@ -3187,7 +3185,7 @@
}
}
- const gl::Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
+ const Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
ASSERT(framebuffer);
if (framebuffer->id() == 0)
@@ -3207,7 +3205,7 @@
return false;
}
- gl::Program *programObject = GetValidProgram(context, program);
+ Program *programObject = GetValidProgram(context, program);
if (!programObject)
{
return false;
@@ -3250,7 +3248,7 @@
return false;
}
- gl::Program *programObject = context->getProgram(program);
+ Program *programObject = context->getProgram(program);
ASSERT(programObject);
// sized queries -- ensure the provided buffer is large enough
@@ -5168,8 +5166,7 @@
return false;
}
- gl::Buffer *pixelUnpackBuffer =
- context->getGLState().getTargetBuffer(BufferBinding::PixelUnpack);
+ Buffer *pixelUnpackBuffer = context->getGLState().getTargetBuffer(BufferBinding::PixelUnpack);
if (pixelUnpackBuffer == nullptr)
{
if (dataSize < imageSize)
@@ -5697,7 +5694,7 @@
}
// Check for pixel pack buffer related API errors
- gl::Buffer *pixelPackBuffer = context->getGLState().getTargetBuffer(BufferBinding::PixelPack);
+ Buffer *pixelPackBuffer = context->getGLState().getTargetBuffer(BufferBinding::PixelPack);
if (pixelPackBuffer != nullptr && pixelPackBuffer->isMapped())
{
// ...the buffer object's data store is currently mapped.
@@ -5714,7 +5711,7 @@
// .. the data would be packed to the buffer object such that the memory writes required
// would exceed the data store size.
const InternalFormat &formatInfo = GetInternalFormatInfo(format, type);
- const gl::Extents size(width, height, 1);
+ const Extents size(width, height, 1);
const auto &pack = context->getGLState().getPackState();
GLuint endByte = 0;