Commit 007530ea by Jamie Madill Committed by Commit Bot

Entry Points: Refactor Extensions Part 2.

This moves the validation and entry point files to use a consistent syntax. This will facilitate auto-generation. Bug: angleproject:2263 Change-Id: If5d06e97db66783d7b3d7fb1d6365f8218d956ae Reviewed-on: https://chromium-review.googlesource.com/846022 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f095799b
...@@ -741,9 +741,9 @@ void Context::setPathCommands(GLuint path, ...@@ -741,9 +741,9 @@ void Context::setPathCommands(GLuint path,
handleError(pathObject->setCommands(numCommands, commands, numCoords, coordType, coords)); handleError(pathObject->setCommands(numCommands, commands, numCoords, coordType, coords));
} }
void Context::setPathParameterf(GLuint path, GLenum pname, GLfloat value) void Context::pathParameterf(GLuint path, GLenum pname, GLfloat value)
{ {
auto *pathObj = mState.mPaths->getPath(path); Path *pathObj = mState.mPaths->getPath(path);
switch (pname) switch (pname)
{ {
...@@ -768,9 +768,15 @@ void Context::setPathParameterf(GLuint path, GLenum pname, GLfloat value) ...@@ -768,9 +768,15 @@ void Context::setPathParameterf(GLuint path, GLenum pname, GLfloat value)
} }
} }
void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) const void Context::pathParameteri(GLuint path, GLenum pname, GLint value)
{ {
const auto *pathObj = mState.mPaths->getPath(path); // TODO(jmadill): Should use proper clamping/casting.
pathParameterf(path, pname, static_cast<GLfloat>(value));
}
void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value)
{
const Path *pathObj = mState.mPaths->getPath(path);
switch (pname) switch (pname)
{ {
...@@ -795,6 +801,14 @@ void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) cons ...@@ -795,6 +801,14 @@ void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) cons
} }
} }
void Context::getPathParameteriv(GLuint path, GLenum pname, GLint *value)
{
GLfloat val = 0.0f;
getPathParameterfv(path, pname, value != nullptr ? &val : nullptr);
if (value)
*value = static_cast<GLint>(val);
}
void Context::setPathStencilFunc(GLenum func, GLint ref, GLuint mask) void Context::setPathStencilFunc(GLenum func, GLint ref, GLuint mask)
{ {
mGLState.setPathStencilFunc(func, ref, mask); mGLState.setPathStencilFunc(func, ref, mask);
...@@ -1840,7 +1854,17 @@ void Context::insertEventMarker(GLsizei length, const char *marker) ...@@ -1840,7 +1854,17 @@ void Context::insertEventMarker(GLsizei length, const char *marker)
void Context::pushGroupMarker(GLsizei length, const char *marker) void Context::pushGroupMarker(GLsizei length, const char *marker)
{ {
ASSERT(mImplementation); ASSERT(mImplementation);
if (marker == nullptr)
{
// From the EXT_debug_marker spec,
// "If <marker> is null then an empty string is pushed on the stack."
mImplementation->pushGroupMarker(length, "");
}
else
{
mImplementation->pushGroupMarker(length, marker); mImplementation->pushGroupMarker(length, marker);
}
} }
void Context::popGroupMarker() void Context::popGroupMarker()
...@@ -3424,7 +3448,7 @@ void Context::generateMipmap(GLenum target) ...@@ -3424,7 +3448,7 @@ void Context::generateMipmap(GLenum target)
handleError(texture->generateMipmap(this)); handleError(texture->generateMipmap(this));
} }
void Context::copyTextureCHROMIUM(GLuint sourceId, void Context::copyTexture(GLuint sourceId,
GLint sourceLevel, GLint sourceLevel,
GLenum destTarget, GLenum destTarget,
GLuint destId, GLuint destId,
...@@ -3445,7 +3469,7 @@ void Context::copyTextureCHROMIUM(GLuint sourceId, ...@@ -3445,7 +3469,7 @@ void Context::copyTextureCHROMIUM(GLuint sourceId,
ConvertToBool(unpackUnmultiplyAlpha), sourceTexture)); ConvertToBool(unpackUnmultiplyAlpha), sourceTexture));
} }
void Context::copySubTextureCHROMIUM(GLuint sourceId, void Context::copySubTexture(GLuint sourceId,
GLint sourceLevel, GLint sourceLevel,
GLenum destTarget, GLenum destTarget,
GLuint destId, GLuint destId,
...@@ -3478,7 +3502,7 @@ void Context::copySubTextureCHROMIUM(GLuint sourceId, ...@@ -3478,7 +3502,7 @@ void Context::copySubTextureCHROMIUM(GLuint sourceId,
ConvertToBool(unpackUnmultiplyAlpha), sourceTexture)); ConvertToBool(unpackUnmultiplyAlpha), sourceTexture));
} }
void Context::compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId) void Context::compressedCopyTexture(GLuint sourceId, GLuint destId)
{ {
syncStateForTexImage(); syncStateForTexImage();
...@@ -5748,4 +5772,45 @@ void Context::readnPixels(GLint x, ...@@ -5748,4 +5772,45 @@ void Context::readnPixels(GLint x,
return readPixels(x, y, width, height, format, type, data); return readPixels(x, y, width, height, format, type, data);
} }
void Context::setFenceNV(GLuint fence, GLenum condition)
{
ASSERT(condition == GL_ALL_COMPLETED_NV);
FenceNV *fenceObject = getFenceNV(fence);
ASSERT(fenceObject != nullptr);
handleError(fenceObject->set(condition));
}
GLboolean Context::testFenceNV(GLuint fence)
{
FenceNV *fenceObject = getFenceNV(fence);
ASSERT(fenceObject != nullptr);
ASSERT(fenceObject->isSet() == GL_TRUE);
GLboolean result = GL_TRUE;
Error error = fenceObject->test(&result);
if (error.isError())
{
handleError(error);
return GL_TRUE;
}
return result;
}
void Context::eGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
{
Texture *texture = getTargetTexture(target);
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
handleError(texture->setEGLImageTarget(this, target, imageObject));
}
void Context::eGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
{
Renderbuffer *renderbuffer = mGLState.getCurrentRenderbuffer();
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
handleError(renderbuffer->setStorageEGLImageTarget(this, imageObject));
}
} // namespace gl } // namespace gl
...@@ -106,8 +106,10 @@ class Context final : public ValidationContext ...@@ -106,8 +106,10 @@ class Context final : public ValidationContext
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords); const void *coords);
void setPathParameterf(GLuint path, GLenum pname, GLfloat value); void pathParameterf(GLuint path, GLenum pname, GLfloat value);
void getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) const; void pathParameteri(GLuint path, GLenum pname, GLint value);
void getPathParameterfv(GLuint path, GLenum pname, GLfloat *value);
void getPathParameteriv(GLuint path, GLenum pname, GLint *value);
void setPathStencilFunc(GLenum func, GLint ref, GLuint mask); void setPathStencilFunc(GLenum func, GLint ref, GLuint mask);
// Framebuffers are owned by the Context, so these methods do not pass through // Framebuffers are owned by the Context, so these methods do not pass through
...@@ -120,6 +122,8 @@ class Context final : public ValidationContext ...@@ -120,6 +122,8 @@ class Context final : public ValidationContext
void finishFenceNV(GLuint fence); void finishFenceNV(GLuint fence);
void getFenceivNV(GLuint fence, GLenum pname, GLint *params); void getFenceivNV(GLuint fence, GLenum pname, GLint *params);
GLboolean isFenceNV(GLuint fence); GLboolean isFenceNV(GLuint fence);
void setFenceNV(GLuint fence, GLenum condition);
GLboolean testFenceNV(GLuint fence);
void bindTexture(GLenum target, GLuint handle); void bindTexture(GLenum target, GLuint handle);
void bindReadFramebuffer(GLuint framebufferHandle); void bindReadFramebuffer(GLuint framebufferHandle);
...@@ -527,7 +531,7 @@ class Context final : public ValidationContext ...@@ -527,7 +531,7 @@ class Context final : public ValidationContext
GLenum format, GLenum format,
GLsizei imageSize, GLsizei imageSize,
const void *data); const void *data);
void copyTextureCHROMIUM(GLuint sourceId, void copyTexture(GLuint sourceId,
GLint sourceLevel, GLint sourceLevel,
GLenum destTarget, GLenum destTarget,
GLuint destId, GLuint destId,
...@@ -537,7 +541,7 @@ class Context final : public ValidationContext ...@@ -537,7 +541,7 @@ class Context final : public ValidationContext
GLboolean unpackFlipY, GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha, GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha); GLboolean unpackUnmultiplyAlpha);
void copySubTextureCHROMIUM(GLuint sourceId, void copySubTexture(GLuint sourceId,
GLint sourceLevel, GLint sourceLevel,
GLenum destTarget, GLenum destTarget,
GLuint destId, GLuint destId,
...@@ -551,7 +555,7 @@ class Context final : public ValidationContext ...@@ -551,7 +555,7 @@ class Context final : public ValidationContext
GLboolean unpackFlipY, GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha, GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha); GLboolean unpackUnmultiplyAlpha);
void compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId); void compressedCopyTexture(GLuint sourceId, GLuint destId);
void generateMipmap(GLenum target); void generateMipmap(GLenum target);
...@@ -979,6 +983,8 @@ class Context final : public ValidationContext ...@@ -979,6 +983,8 @@ class Context final : public ValidationContext
GLenum type, GLenum type,
GLsizei bufSize, GLsizei bufSize,
void *data); void *data);
void eGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
void eGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
// Consumes the error. // Consumes the error.
void handleError(const Error &error) override; void handleError(const Error &error) override;
......
...@@ -3167,8 +3167,15 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -3167,8 +3167,15 @@ bool ValidateDiscardFramebufferBase(Context *context,
bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *marker) bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *marker)
{ {
// Note that debug marker calls must not set error state if (!context->getExtensions().debugMarker)
{
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
// Note that debug marker calls must not set error state
if (length < 0) if (length < 0)
{ {
return false; return false;
...@@ -3184,8 +3191,15 @@ bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char * ...@@ -3184,8 +3191,15 @@ bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *
bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *marker) bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *marker)
{ {
// Note that debug marker calls must not set error state if (!context->getExtensions().debugMarker)
{
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
// Note that debug marker calls must not set error state
if (length < 0) if (length < 0)
{ {
return false; return false;
...@@ -3199,9 +3213,7 @@ bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *ma ...@@ -3199,9 +3213,7 @@ bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *ma
return true; return true;
} }
bool ValidateEGLImageTargetTexture2DOES(Context *context, bool ValidateEGLImageTargetTexture2DOES(Context *context, GLenum target, GLeglImageOES image)
GLenum target,
egl::Image *image)
{ {
if (!context->getExtensions().eglImage && !context->getExtensions().eglImageExternal) if (!context->getExtensions().eglImage && !context->getExtensions().eglImageExternal)
{ {
...@@ -3232,14 +3244,16 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context, ...@@ -3232,14 +3244,16 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
return false; return false;
} }
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay()); ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(image)) if (!context->getCurrentDisplay()->isValidImage(imageObject))
{ {
context->handleError(InvalidValue() << "EGL image is not valid."); context->handleError(InvalidValue() << "EGL image is not valid.");
return false; return false;
} }
if (image->getSamples() > 0) if (imageObject->getSamples() > 0)
{ {
context->handleError(InvalidOperation() context->handleError(InvalidOperation()
<< "cannot create a 2D texture from a multisampled EGL image."); << "cannot create a 2D texture from a multisampled EGL image.");
...@@ -3247,7 +3261,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context, ...@@ -3247,7 +3261,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
} }
const TextureCaps &textureCaps = const TextureCaps &textureCaps =
context->getTextureCaps().get(image->getFormat().info->sizedInternalFormat); context->getTextureCaps().get(imageObject->getFormat().info->sizedInternalFormat);
if (!textureCaps.texturable) if (!textureCaps.texturable)
{ {
context->handleError(InvalidOperation() context->handleError(InvalidOperation()
...@@ -3260,7 +3274,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context, ...@@ -3260,7 +3274,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context, bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
GLenum target, GLenum target,
egl::Image *image) GLeglImageOES image)
{ {
if (!context->getExtensions().eglImage) if (!context->getExtensions().eglImage)
{ {
...@@ -3278,15 +3292,17 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context, ...@@ -3278,15 +3292,17 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
return false; return false;
} }
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay()); ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(image)) if (!context->getCurrentDisplay()->isValidImage(imageObject))
{ {
context->handleError(InvalidValue() << "EGL image is not valid."); context->handleError(InvalidValue() << "EGL image is not valid.");
return false; return false;
} }
const TextureCaps &textureCaps = const TextureCaps &textureCaps =
context->getTextureCaps().get(image->getFormat().info->sizedInternalFormat); context->getTextureCaps().get(imageObject->getFormat().info->sizedInternalFormat);
if (!textureCaps.renderable) if (!textureCaps.renderable)
{ {
context->handleError(InvalidOperation() context->handleError(InvalidOperation()
......
...@@ -39,7 +39,6 @@ bool ValidTexture2DDestinationTarget(const ValidationContext *context, GLenum ta ...@@ -39,7 +39,6 @@ bool ValidTexture2DDestinationTarget(const ValidationContext *context, GLenum ta
bool ValidTexture3DDestinationTarget(const ValidationContext *context, GLenum target); bool ValidTexture3DDestinationTarget(const ValidationContext *context, GLenum target);
bool ValidTexLevelDestinationTarget(const ValidationContext *context, GLenum target); bool ValidTexLevelDestinationTarget(const ValidationContext *context, GLenum target);
bool ValidFramebufferTarget(const ValidationContext *context, GLenum target); bool ValidFramebufferTarget(const ValidationContext *context, GLenum target);
bool ValidBufferParameter(const ValidationContext *context, GLenum pname, GLsizei *numParams);
bool ValidMipLevel(const ValidationContext *context, GLenum target, GLint level); bool ValidMipLevel(const ValidationContext *context, GLenum target, GLint level);
bool ValidImageSizeParameters(ValidationContext *context, bool ValidImageSizeParameters(ValidationContext *context,
GLenum target, GLenum target,
...@@ -337,12 +336,10 @@ bool ValidateDiscardFramebufferBase(Context *context, ...@@ -337,12 +336,10 @@ bool ValidateDiscardFramebufferBase(Context *context,
bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *marker); bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *marker);
bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *marker); bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *marker);
bool ValidateEGLImageTargetTexture2DOES(Context *context, bool ValidateEGLImageTargetTexture2DOES(Context *context, GLenum target, GLeglImageOES image);
GLenum target,
egl::Image *image);
bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context, bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
GLenum target, GLenum target,
egl::Image *image); GLeglImageOES image);
bool ValidateBindVertexArrayBase(Context *context, GLuint array); bool ValidateBindVertexArrayBase(Context *context, GLuint array);
......
...@@ -1002,6 +1002,21 @@ bool ValidateWebGLNameLength(ValidationContext *context, size_t length) ...@@ -1002,6 +1002,21 @@ bool ValidateWebGLNameLength(ValidationContext *context, size_t length)
return true; return true;
} }
bool ValidateMatrixMode(Context *context, GLenum matrixMode)
{
if (!context->getExtensions().pathRendering)
{
context->handleError(InvalidOperation() << "GL_CHROMIUM_path_rendering is not available.");
return false;
}
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false;
}
return true;
}
} // anonymous namespace } // anonymous namespace
bool ValidateES2TexImageParameters(Context *context, bool ValidateES2TexImageParameters(Context *context,
...@@ -3074,42 +3089,28 @@ bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components) ...@@ -3074,42 +3089,28 @@ bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components)
// CHROMIUM_path_rendering // CHROMIUM_path_rendering
bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix) bool ValidateMatrixLoadfCHROMIUM(Context *context, GLenum matrixMode, const GLfloat *matrix)
{ {
if (!context->getExtensions().pathRendering) if (!ValidateMatrixMode(context, matrixMode))
{ {
context->handleError(InvalidOperation() << "GL_CHROMIUM_path_rendering is not available.");
return false;
}
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false; return false;
} }
if (matrix == nullptr) if (matrix == nullptr)
{ {
context->handleError(InvalidOperation() << "Invalid matrix."); context->handleError(InvalidOperation() << "Invalid matrix.");
return false; return false;
} }
return true; return true;
} }
bool ValidateMatrixMode(Context *context, GLenum matrixMode) bool ValidateMatrixLoadIdentityCHROMIUM(Context *context, GLenum matrixMode)
{ {
if (!context->getExtensions().pathRendering) return ValidateMatrixMode(context, matrixMode);
{
context->handleError(InvalidOperation() << "GL_CHROMIUM_path_rendering is not available.");
return false;
}
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false;
}
return true;
} }
bool ValidateGenPaths(Context *context, GLsizei range) bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3134,7 +3135,7 @@ bool ValidateGenPaths(Context *context, GLsizei range) ...@@ -3134,7 +3135,7 @@ bool ValidateGenPaths(Context *context, GLsizei range)
return true; return true;
} }
bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range) bool ValidateDeletePathsCHROMIUM(Context *context, GLuint path, GLsizei range)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3161,7 +3162,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range) ...@@ -3161,7 +3162,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range)
return true; return true;
} }
bool ValidatePathCommands(Context *context, bool ValidatePathCommandsCHROMIUM(Context *context,
GLuint path, GLuint path,
GLsizei numCommands, GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
...@@ -3282,7 +3283,7 @@ bool ValidatePathCommands(Context *context, ...@@ -3282,7 +3283,7 @@ bool ValidatePathCommands(Context *context,
return true; return true;
} }
bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat value) bool ValidatePathParameterfCHROMIUM(Context *context, GLuint path, GLenum pname, GLfloat value)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3346,7 +3347,13 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo ...@@ -3346,7 +3347,13 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
return true; return true;
} }
bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat *value) bool ValidatePathParameteriCHROMIUM(Context *context, GLuint path, GLenum pname, GLint value)
{
// TODO(jmadill): Use proper clamping cast.
return ValidatePathParameterfCHROMIUM(context, path, pname, static_cast<GLfloat>(value));
}
bool ValidateGetPathParameterfvCHROMIUM(Context *context, GLuint path, GLenum pname, GLfloat *value)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3382,7 +3389,13 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo ...@@ -3382,7 +3389,13 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
return true; return true;
} }
bool ValidatePathStencilFunc(Context *context, GLenum func, GLint ref, GLuint mask) bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pname, GLint *value)
{
return ValidateGetPathParameterfvCHROMIUM(context, path, pname,
reinterpret_cast<GLfloat *>(value));
}
bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3415,7 +3428,7 @@ bool ValidatePathStencilFunc(Context *context, GLenum func, GLint ref, GLuint ma ...@@ -3415,7 +3428,7 @@ bool ValidatePathStencilFunc(Context *context, GLenum func, GLint ref, GLuint ma
// However if the path object exists but has not been specified any // However if the path object exists but has not been specified any
// commands then an error is generated. // commands then an error is generated.
bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLuint mask) bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, GLuint mask)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3447,7 +3460,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu ...@@ -3447,7 +3460,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
return true; return true;
} }
bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, GLuint mask) bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint reference, GLuint mask)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3463,7 +3476,7 @@ bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, G ...@@ -3463,7 +3476,7 @@ bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, G
return true; return true;
} }
bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode) bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3488,27 +3501,27 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode) ...@@ -3488,27 +3501,27 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
return true; return true;
} }
bool ValidateStencilThenCoverFillPath(Context *context, bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path, GLuint path,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode) GLenum coverMode)
{ {
return ValidateStencilFillPath(context, path, fillMode, mask) && return ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask) &&
ValidateCoverPath(context, path, coverMode); ValidateCoverPathCHROMIUM(context, path, coverMode);
} }
bool ValidateStencilThenCoverStrokePath(Context *context, bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLuint path, GLuint path,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode) GLenum coverMode)
{ {
return ValidateStencilStrokePath(context, path, reference, mask) && return ValidateStencilStrokePathCHROMIUM(context, path, reference, mask) &&
ValidateCoverPath(context, path, coverMode); ValidateCoverPathCHROMIUM(context, path, coverMode);
} }
bool ValidateIsPath(Context *context) bool ValidateIsPathCHROMIUM(Context *context)
{ {
if (!context->getExtensions().pathRendering) if (!context->getExtensions().pathRendering)
{ {
...@@ -3518,7 +3531,7 @@ bool ValidateIsPath(Context *context) ...@@ -3518,7 +3531,7 @@ bool ValidateIsPath(Context *context)
return true; return true;
} }
bool ValidateCoverFillPathInstanced(Context *context, bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3545,7 +3558,7 @@ bool ValidateCoverFillPathInstanced(Context *context, ...@@ -3545,7 +3558,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
return true; return true;
} }
bool ValidateCoverStrokePathInstanced(Context *context, bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3572,7 +3585,7 @@ bool ValidateCoverStrokePathInstanced(Context *context, ...@@ -3572,7 +3585,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
return true; return true;
} }
bool ValidateStencilFillPathInstanced(Context *context, bool ValidateStencilFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3604,7 +3617,7 @@ bool ValidateStencilFillPathInstanced(Context *context, ...@@ -3604,7 +3617,7 @@ bool ValidateStencilFillPathInstanced(Context *context,
return true; return true;
} }
bool ValidateStencilStrokePathInstanced(Context *context, bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3623,7 +3636,7 @@ bool ValidateStencilStrokePathInstanced(Context *context, ...@@ -3623,7 +3636,7 @@ bool ValidateStencilStrokePathInstanced(Context *context,
return true; return true;
} }
bool ValidateStencilThenCoverFillPathInstanced(Context *context, bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3667,7 +3680,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context, ...@@ -3667,7 +3680,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
return true; return true;
} }
bool ValidateStencilThenCoverStrokePathInstanced(Context *context, bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -3696,7 +3709,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context, ...@@ -3696,7 +3709,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
return true; return true;
} }
bool ValidateBindFragmentInputLocation(Context *context, bool ValidateBindFragmentInputLocationCHROMIUM(Context *context,
GLuint program, GLuint program,
GLint location, GLint location,
const GLchar *name) const GLchar *name)
...@@ -3736,7 +3749,7 @@ bool ValidateBindFragmentInputLocation(Context *context, ...@@ -3736,7 +3749,7 @@ bool ValidateBindFragmentInputLocation(Context *context,
return true; return true;
} }
bool ValidateProgramPathFragmentInputGen(Context *context, bool ValidateProgramPathFragmentInputGenCHROMIUM(Context *context,
GLuint program, GLuint program,
GLint location, GLint location,
GLenum genMode, GLenum genMode,
...@@ -6495,4 +6508,142 @@ bool ValidateIsFenceNV(Context *context, GLuint fence) ...@@ -6495,4 +6508,142 @@ bool ValidateIsFenceNV(Context *context, GLuint fence)
return true; return true;
} }
bool ValidateSetFenceNV(Context *context, GLuint fence, GLenum condition)
{
if (!context->getExtensions().fence)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), NVFenceNotSupported);
return false;
}
if (condition != GL_ALL_COMPLETED_NV)
{
context->handleError(InvalidEnum());
return false;
}
FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == nullptr)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidFence);
return false;
}
return true;
}
bool ValidateTestFenceNV(Context *context, GLuint fence)
{
if (!context->getExtensions().fence)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), NVFenceNotSupported);
return false;
}
FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == nullptr)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidFence);
return false;
}
if (fenceObject->isSet() != GL_TRUE)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidFenceState);
return false;
}
return true;
}
bool ValidateTexStorage2DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height)
{
if (!context->getExtensions().textureStorage)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
if (context->getClientMajorVersion() < 3)
{
return ValidateES2TexStorageParameters(context, target, levels, internalformat, width,
height);
}
ASSERT(context->getClientMajorVersion() >= 3);
return ValidateES3TexStorage2DParameters(context, target, levels, internalformat, width, height,
1);
}
bool ValidateVertexAttribDivisorANGLE(Context *context, GLuint index, GLuint divisor)
{
if (!context->getExtensions().instancedArrays)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
if (index >= MAX_VERTEX_ATTRIBS)
{
context->handleError(InvalidValue());
return false;
}
if (context->getLimitations().attributeZeroRequiresZeroDivisorInEXT)
{
if (index == 0 && divisor != 0)
{
const char *errorMessage =
"The current context doesn't support setting a non-zero divisor on the "
"attribute with index zero. "
"Please reorder the attributes in your vertex shader so that attribute zero "
"can have a zero divisor.";
context->handleError(InvalidOperation() << errorMessage);
// We also output an error message to the debugger window if tracing is active, so
// that developers can see the error message.
ERR() << errorMessage;
return false;
}
}
return true;
}
bool ValidateTexImage3DOES(Context *context,
GLenum target,
GLint level,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
const void *pixels)
{
UNIMPLEMENTED(); // FIXME
return false;
}
bool ValidatePopGroupMarkerEXT(Context *context)
{
if (!context->getExtensions().debugMarker)
{
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
return true;
}
} // namespace gl } // namespace gl
...@@ -227,35 +227,40 @@ bool ValidateBindUniformLocationCHROMIUM(Context *context, ...@@ -227,35 +227,40 @@ bool ValidateBindUniformLocationCHROMIUM(Context *context,
bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components); bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components);
// CHROMIUM_path_rendering // CHROMIUM_path_rendering
bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix); bool ValidateMatrixLoadfCHROMIUM(Context *context, GLenum matrixMode, const GLfloat *matrix);
bool ValidateMatrixMode(Context *context, GLenum matrixMode); bool ValidateMatrixLoadIdentityCHROMIUM(Context *context, GLenum matrixMode);
bool ValidateGenPaths(Context *context, GLsizei range); bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range);
bool ValidateDeletePaths(Context *context, GLuint first, GLsizei range); bool ValidateDeletePathsCHROMIUM(Context *context, GLuint first, GLsizei range);
bool ValidatePathCommands(Context *context, bool ValidatePathCommandsCHROMIUM(Context *context,
GLuint path, GLuint path,
GLsizei numCommands, GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords); const void *coords);
bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat value); bool ValidatePathParameterfCHROMIUM(Context *context, GLuint path, GLenum pname, GLfloat value);
bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat *value); bool ValidatePathParameteriCHROMIUM(Context *context, GLuint path, GLenum pname, GLint value);
bool ValidatePathStencilFunc(Context *context, GLenum func, GLint ref, GLuint mask); bool ValidateGetPathParameterfvCHROMIUM(Context *context,
bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLuint mask); GLuint path,
bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, GLuint mask); GLenum pname,
bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode); GLfloat *value);
bool ValidateStencilThenCoverFillPath(Context *context, bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pname, GLint *value);
bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask);
bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, GLuint mask);
bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint reference, GLuint mask);
bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode);
bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path, GLuint path,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode); GLenum coverMode);
bool ValidateStencilThenCoverStrokePath(Context *context, bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLuint path, GLuint path,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode); GLenum coverMode);
bool ValidateIsPath(Context *context); bool ValidateIsPathCHROMIUM(Context *context);
bool ValidateCoverFillPathInstanced(Context *context, bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -263,7 +268,7 @@ bool ValidateCoverFillPathInstanced(Context *context, ...@@ -263,7 +268,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateCoverStrokePathInstanced(Context *context, bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -271,7 +276,7 @@ bool ValidateCoverStrokePathInstanced(Context *context, ...@@ -271,7 +276,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateStencilFillPathInstanced(Context *context, bool ValidateStencilFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -280,7 +285,7 @@ bool ValidateStencilFillPathInstanced(Context *context, ...@@ -280,7 +285,7 @@ bool ValidateStencilFillPathInstanced(Context *context,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateStencilStrokePathInstanced(Context *context, bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -289,7 +294,7 @@ bool ValidateStencilStrokePathInstanced(Context *context, ...@@ -289,7 +294,7 @@ bool ValidateStencilStrokePathInstanced(Context *context,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateStencilThenCoverFillPathInstanced(Context *context, bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -299,7 +304,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context, ...@@ -299,7 +304,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateStencilThenCoverStrokePathInstanced(Context *context, bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
...@@ -309,11 +314,11 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context, ...@@ -309,11 +314,11 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
bool ValidateBindFragmentInputLocation(Context *context, bool ValidateBindFragmentInputLocationCHROMIUM(Context *context,
GLuint program, GLuint program,
GLint location, GLint location,
const GLchar *name); const GLchar *name);
bool ValidateProgramPathFragmentInputGen(Context *context, bool ValidateProgramPathFragmentInputGenCHROMIUM(Context *context,
GLuint program, GLuint program,
GLint location, GLint location,
GLenum genMode, GLenum genMode,
...@@ -694,6 +699,27 @@ bool ValidateGetTranslatedShaderSourceANGLE(Context *context, ...@@ -694,6 +699,27 @@ bool ValidateGetTranslatedShaderSourceANGLE(Context *context,
GLsizei *length, GLsizei *length,
GLchar *source); GLchar *source);
bool ValidateIsFenceNV(Context *context, GLuint fence); bool ValidateIsFenceNV(Context *context, GLuint fence);
bool ValidateSetFenceNV(Context *context, GLuint fence, GLenum condition);
bool ValidateTestFenceNV(Context *context, GLuint fence);
bool ValidateTexStorage2DEXT(Context *context,
GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
GLsizei height);
bool ValidateVertexAttribDivisorANGLE(Context *context, GLuint index, GLuint divisor);
bool ValidateTexImage3DOES(Context *context,
GLenum target,
GLint level,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
const void *pixels);
bool ValidatePopGroupMarkerEXT(Context *context);
} // namespace gl } // namespace gl
......
...@@ -498,26 +498,12 @@ void GL_APIENTRY SetFenceNV(GLuint fence, GLenum condition) ...@@ -498,26 +498,12 @@ void GL_APIENTRY SetFenceNV(GLuint fence, GLenum condition)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (condition != GL_ALL_COMPLETED_NV) if (!context->skipValidation() && !ValidateSetFenceNV(context, fence, condition))
{ {
context->handleError(InvalidEnum());
return; return;
} }
FenceNV *fenceObject = context->getFenceNV(fence); context->setFenceNV(fence, condition);
if (fenceObject == nullptr)
{
context->handleError(InvalidOperation());
return;
}
Error error = fenceObject->set(condition);
if (error.isError())
{
context->handleError(error);
return;
}
} }
} }
...@@ -528,29 +514,12 @@ GLboolean GL_APIENTRY TestFenceNV(GLuint fence) ...@@ -528,29 +514,12 @@ GLboolean GL_APIENTRY TestFenceNV(GLuint fence)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
FenceNV *fenceObject = context->getFenceNV(fence); if (!context->skipValidation() && !ValidateTestFenceNV(context, fence))
if (fenceObject == nullptr)
{ {
context->handleError(InvalidOperation());
return GL_TRUE; return GL_TRUE;
} }
if (fenceObject->isSet() != GL_TRUE) return context->testFenceNV(fence);
{
context->handleError(InvalidOperation());
return GL_TRUE;
}
GLboolean result;
Error error = fenceObject->test(&result);
if (error.isError())
{
context->handleError(error);
return GL_TRUE;
}
return result;
} }
return GL_TRUE; return GL_TRUE;
...@@ -567,22 +536,8 @@ TexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei wi ...@@ -567,22 +536,8 @@ TexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei wi
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->getExtensions().textureStorage) if (!context->skipValidation() &&
{ !ValidateTexStorage2DEXT(context, target, levels, internalformat, width, height))
context->handleError(InvalidOperation());
return;
}
if (context->getClientMajorVersion() < 3 &&
!ValidateES2TexStorageParameters(context, target, levels, internalformat, width,
height))
{
return;
}
if (context->getClientMajorVersion() >= 3 &&
!ValidateES3TexStorage2DParameters(context, target, levels, internalformat, width,
height, 1))
{ {
return; return;
} }
...@@ -598,36 +553,11 @@ void GL_APIENTRY VertexAttribDivisorANGLE(GLuint index, GLuint divisor) ...@@ -598,36 +553,11 @@ void GL_APIENTRY VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->getExtensions().instancedArrays) if (!context->skipValidation() &&
{ !ValidateVertexAttribDivisorANGLE(context, index, divisor))
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return;
}
if (index >= MAX_VERTEX_ATTRIBS)
{
context->handleError(InvalidValue());
return;
}
if (context->getLimitations().attributeZeroRequiresZeroDivisorInEXT)
{
if (index == 0 && divisor != 0)
{ {
const char *errorMessage =
"The current context doesn't support setting a non-zero divisor on the "
"attribute with index zero. "
"Please reorder the attributes in your vertex shader so that attribute zero "
"can have a zero divisor.";
context->handleError(InvalidOperation() << errorMessage);
// We also output an error message to the debugger window if tracing is active, so
// that developers can see the error message.
ERR() << errorMessage;
return; return;
} }
}
context->vertexAttribDivisor(index, divisor); context->vertexAttribDivisor(index, divisor);
} }
...@@ -702,7 +632,19 @@ void GL_APIENTRY TexImage3DOES(GLenum target, ...@@ -702,7 +632,19 @@ void GL_APIENTRY TexImage3DOES(GLenum target,
"GLenum format = 0x%X, GLenum type = 0x%x, const void* pixels = 0x%0.8p)", "GLenum format = 0x%X, GLenum type = 0x%x, const void* pixels = 0x%0.8p)",
target, level, internalformat, width, height, depth, border, format, type, pixels); target, level, internalformat, width, height, depth, border, format, type, pixels);
UNIMPLEMENTED(); // FIXME Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateTexImage3DOES(context, target, level, internalformat, width, height, depth,
border, format, type, pixels))
{
return;
}
context->texImage3D(target, level, internalformat, width, height, depth, border, format,
type, pixels);
}
} }
void GL_APIENTRY GetProgramBinaryOES(GLuint program, void GL_APIENTRY GetProgramBinaryOES(GLuint program,
...@@ -881,15 +823,7 @@ void GL_APIENTRY InsertEventMarkerEXT(GLsizei length, const char *marker) ...@@ -881,15 +823,7 @@ void GL_APIENTRY InsertEventMarkerEXT(GLsizei length, const char *marker)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->getExtensions().debugMarker) if (!context->skipValidation() && !ValidateInsertEventMarkerEXT(context, length, marker))
{
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
context->handleError(InvalidOperation() << "Extension not enabled");
return;
}
if (!ValidateInsertEventMarkerEXT(context, length, marker))
{ {
return; return;
} }
...@@ -906,30 +840,13 @@ void GL_APIENTRY PushGroupMarkerEXT(GLsizei length, const char *marker) ...@@ -906,30 +840,13 @@ void GL_APIENTRY PushGroupMarkerEXT(GLsizei length, const char *marker)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->getExtensions().debugMarker) if (!context->skipValidation() && !ValidatePushGroupMarkerEXT(context, length, marker))
{
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
context->handleError(InvalidOperation() << "Extension not enabled");
return;
}
if (!ValidatePushGroupMarkerEXT(context, length, marker))
{ {
return; return;
} }
if (marker == nullptr)
{
// From the EXT_debug_marker spec,
// "If <marker> is null then an empty string is pushed on the stack."
context->pushGroupMarker(length, "");
}
else
{
context->pushGroupMarker(length, marker); context->pushGroupMarker(length, marker);
} }
}
} }
void GL_APIENTRY PopGroupMarkerEXT() void GL_APIENTRY PopGroupMarkerEXT()
...@@ -940,11 +857,8 @@ void GL_APIENTRY PopGroupMarkerEXT() ...@@ -940,11 +857,8 @@ void GL_APIENTRY PopGroupMarkerEXT()
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->getExtensions().debugMarker) if (!context->skipValidation() && !ValidatePopGroupMarkerEXT(context))
{ {
// The debug marker calls should not set error state
// However, it seems reasonable to set an error state if the extension is not enabled
context->handleError(InvalidOperation() << "Extension not enabled");
return; return;
} }
...@@ -959,19 +873,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetTexture2DOES(GLenum target, GLeglIma ...@@ -959,19 +873,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetTexture2DOES(GLenum target, GLeglIma
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image); if (!context->skipValidation() &&
if (!ValidateEGLImageTargetTexture2DOES(context, target, imageObject)) !ValidateEGLImageTargetTexture2DOES(context, target, image))
{ {
return; return;
} }
Texture *texture = context->getTargetTexture(target); context->eGLImageTargetTexture2DOES(target, image);
Error error = texture->setEGLImageTarget(context, target, imageObject);
if (error.isError())
{
context->handleError(error);
return;
}
} }
} }
...@@ -983,19 +891,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetRenderbufferStorageOES(GLenum target ...@@ -983,19 +891,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetRenderbufferStorageOES(GLenum target
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image); if (!context->skipValidation() &&
if (!ValidateEGLImageTargetRenderbufferStorageOES(context, target, imageObject)) !ValidateEGLImageTargetRenderbufferStorageOES(context, target, image))
{ {
return; return;
} }
Renderbuffer *renderbuffer = context->getGLState().getCurrentRenderbuffer(); context->eGLImageTargetRenderbufferStorageOES(target, image);
Error error = renderbuffer->setStorageEGLImageTarget(context, imageObject);
if (error.isError())
{
context->handleError(error);
return;
}
} }
} }
...@@ -1080,7 +982,8 @@ void GL_APIENTRY DebugMessageControlKHR(GLenum source, ...@@ -1080,7 +982,8 @@ void GL_APIENTRY DebugMessageControlKHR(GLenum source,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled)) if (!context->skipValidation() &&
!ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled))
{ {
return; return;
} }
...@@ -1104,7 +1007,8 @@ void GL_APIENTRY DebugMessageInsertKHR(GLenum source, ...@@ -1104,7 +1007,8 @@ void GL_APIENTRY DebugMessageInsertKHR(GLenum source,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf)) if (!context->skipValidation() &&
!ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf))
{ {
return; return;
} }
...@@ -1121,7 +1025,8 @@ void GL_APIENTRY DebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void *us ...@@ -1121,7 +1025,8 @@ void GL_APIENTRY DebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void *us
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateDebugMessageCallbackKHR(context, callback, userParam)) if (!context->skipValidation() &&
!ValidateDebugMessageCallbackKHR(context, callback, userParam))
{ {
return; return;
} }
...@@ -1148,7 +1053,8 @@ GLuint GL_APIENTRY GetDebugMessageLogKHR(GLuint count, ...@@ -1148,7 +1053,8 @@ GLuint GL_APIENTRY GetDebugMessageLogKHR(GLuint count,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types, ids, severities, if (!context->skipValidation() &&
!ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types, ids, severities,
lengths, messageLog)) lengths, messageLog))
{ {
return 0; return 0;
...@@ -1171,7 +1077,8 @@ void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, con ...@@ -1171,7 +1077,8 @@ void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, con
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidatePushDebugGroupKHR(context, source, id, length, message)) if (!context->skipValidation() &&
!ValidatePushDebugGroupKHR(context, source, id, length, message))
{ {
return; return;
} }
...@@ -1188,7 +1095,7 @@ void GL_APIENTRY PopDebugGroupKHR(void) ...@@ -1188,7 +1095,7 @@ void GL_APIENTRY PopDebugGroupKHR(void)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidatePopDebugGroupKHR(context)) if (!context->skipValidation() && !ValidatePopDebugGroupKHR(context))
{ {
return; return;
} }
...@@ -1207,7 +1114,8 @@ void GL_APIENTRY ObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length, ...@@ -1207,7 +1114,8 @@ void GL_APIENTRY ObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateObjectLabelKHR(context, identifier, name, length, label)) if (!context->skipValidation() &&
!ValidateObjectLabelKHR(context, identifier, name, length, label))
{ {
return; return;
} }
...@@ -1227,7 +1135,8 @@ GetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *leng ...@@ -1227,7 +1135,8 @@ GetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *leng
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label)) if (!context->skipValidation() &&
!ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label))
{ {
return; return;
} }
...@@ -1244,7 +1153,7 @@ void GL_APIENTRY ObjectPtrLabelKHR(const void *ptr, GLsizei length, const GLchar ...@@ -1244,7 +1153,7 @@ void GL_APIENTRY ObjectPtrLabelKHR(const void *ptr, GLsizei length, const GLchar
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateObjectPtrLabelKHR(context, ptr, length, label)) if (!context->skipValidation() && !ValidateObjectPtrLabelKHR(context, ptr, length, label))
{ {
return; return;
} }
...@@ -1266,7 +1175,8 @@ void GL_APIENTRY GetObjectPtrLabelKHR(const void *ptr, ...@@ -1266,7 +1175,8 @@ void GL_APIENTRY GetObjectPtrLabelKHR(const void *ptr,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label)) if (!context->skipValidation() &&
!ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label))
{ {
return; return;
} }
...@@ -1282,7 +1192,7 @@ void GL_APIENTRY GetPointervKHR(GLenum pname, void **params) ...@@ -1282,7 +1192,7 @@ void GL_APIENTRY GetPointervKHR(GLenum pname, void **params)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateGetPointervKHR(context, pname, params)) if (!context->skipValidation() && !ValidateGetPointervKHR(context, pname, params))
{ {
return; return;
} }
...@@ -1301,7 +1211,8 @@ ANGLE_EXPORT void GL_APIENTRY BindUniformLocationCHROMIUM(GLuint program, ...@@ -1301,7 +1211,8 @@ ANGLE_EXPORT void GL_APIENTRY BindUniformLocationCHROMIUM(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateBindUniformLocationCHROMIUM(context, program, location, name)) if (!context->skipValidation() &&
!ValidateBindUniformLocationCHROMIUM(context, program, location, name))
{ {
return; return;
} }
...@@ -1317,7 +1228,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverageModulationCHROMIUM(GLenum components) ...@@ -1317,7 +1228,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverageModulationCHROMIUM(GLenum components)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateCoverageModulationCHROMIUM(context, components)) if (!context->skipValidation() && !ValidateCoverageModulationCHROMIUM(context, components))
{ {
return; return;
} }
...@@ -1333,7 +1244,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadfCHROMIUM(GLenum matrixMode, const GLflo ...@@ -1333,7 +1244,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadfCHROMIUM(GLenum matrixMode, const GLflo
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateMatrix(context, matrixMode, matrix)) if (!context->skipValidation() && !ValidateMatrixLoadfCHROMIUM(context, matrixMode, matrix))
{ {
return; return;
} }
...@@ -1348,7 +1259,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadIdentityCHROMIUM(GLenum matrixMode) ...@@ -1348,7 +1259,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadIdentityCHROMIUM(GLenum matrixMode)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateMatrixMode(context, matrixMode)) if (!context->skipValidation() && !ValidateMatrixLoadIdentityCHROMIUM(context, matrixMode))
{ {
return; return;
} }
...@@ -1363,7 +1274,7 @@ ANGLE_EXPORT GLuint GL_APIENTRY GenPathsCHROMIUM(GLsizei range) ...@@ -1363,7 +1274,7 @@ ANGLE_EXPORT GLuint GL_APIENTRY GenPathsCHROMIUM(GLsizei range)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateGenPaths(context, range)) if (!context->skipValidation() && !ValidateGenPathsCHROMIUM(context, range))
{ {
return 0; return 0;
} }
...@@ -1379,7 +1290,7 @@ ANGLE_EXPORT void GL_APIENTRY DeletePathsCHROMIUM(GLuint first, GLsizei range) ...@@ -1379,7 +1290,7 @@ ANGLE_EXPORT void GL_APIENTRY DeletePathsCHROMIUM(GLuint first, GLsizei range)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateDeletePaths(context, first, range)) if (!context->skipValidation() && !ValidateDeletePathsCHROMIUM(context, first, range))
{ {
return; return;
} }
...@@ -1394,7 +1305,7 @@ ANGLE_EXPORT GLboolean GL_APIENTRY IsPathCHROMIUM(GLuint path) ...@@ -1394,7 +1305,7 @@ ANGLE_EXPORT GLboolean GL_APIENTRY IsPathCHROMIUM(GLuint path)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateIsPath(context)) if (!context->skipValidation() && !ValidateIsPathCHROMIUM(context))
{ {
return GL_FALSE; return GL_FALSE;
} }
...@@ -1418,14 +1329,12 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path, ...@@ -1418,14 +1329,12 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() &&
{ !ValidatePathCommandsCHROMIUM(context, path, numCommands, commands, numCoords,
if (!ValidatePathCommands(context, path, numCommands, commands, numCoords, coordType, coordType, coords))
coords))
{ {
return; return;
} }
}
context->setPathCommands(path, numCommands, commands, numCoords, coordType, coords); context->setPathCommands(path, numCommands, commands, numCoords, coordType, coords);
} }
} }
...@@ -1437,27 +1346,42 @@ ANGLE_EXPORT void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname, ...@@ -1437,27 +1346,42 @@ ANGLE_EXPORT void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateSetPathParameter(context, path, pname, value)) if (!context->skipValidation() &&
!ValidatePathParameterfCHROMIUM(context, path, pname, value))
{ {
return; return;
} }
context->setPathParameterf(path, pname, value);
context->pathParameterf(path, pname, value);
} }
} }
ANGLE_EXPORT void GL_APIENTRY PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) ANGLE_EXPORT void GL_APIENTRY PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value)
{ {
PathParameterfCHROMIUM(path, pname, static_cast<GLfloat>(value)); EVENT("(GLuint path = %u, GLenum pname = %u, GLint value = %d)", path, pname, value);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidatePathParameteriCHROMIUM(context, path, pname, value))
{
return;
}
context->pathParameteri(path, pname, value);
}
} }
ANGLE_EXPORT void GL_APIENTRY GetPathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat *value) ANGLE_EXPORT void GL_APIENTRY GetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *value)
{ {
EVENT("(GLuint path = %u, GLenum pname = %u)", path, pname); EVENT("(GLuint path = %u, GLenum pname = %u, GLfloat *value = %p)", path, pname, value);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateGetPathParameter(context, path, pname, value)) if (!context->skipValidation() &&
!ValidateGetPathParameterfvCHROMIUM(context, path, pname, value))
{ {
return; return;
} }
...@@ -1465,12 +1389,20 @@ ANGLE_EXPORT void GL_APIENTRY GetPathParameterfCHROMIUM(GLuint path, GLenum pnam ...@@ -1465,12 +1389,20 @@ ANGLE_EXPORT void GL_APIENTRY GetPathParameterfCHROMIUM(GLuint path, GLenum pnam
} }
} }
ANGLE_EXPORT void GL_APIENTRY GetPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint *value) ANGLE_EXPORT void GL_APIENTRY GetPathParameterivCHROMIUM(GLuint path, GLenum pname, GLint *value)
{ {
GLfloat val = 0.0f; EVENT("(GLuint path = %u, GLenum pname = %u, GLint *value = %p)", path, pname, value);
GetPathParameterfCHROMIUM(path, pname, value != nullptr ? &val : nullptr);
if (value) Context *context = GetValidGlobalContext();
*value = static_cast<GLint>(val); if (context)
{
if (!context->skipValidation() &&
!ValidateGetPathParameterivCHROMIUM(context, path, pname, value))
{
return;
}
context->getPathParameteriv(path, pname, value);
}
} }
ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask)
...@@ -1480,7 +1412,8 @@ ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GL ...@@ -1480,7 +1412,8 @@ ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GL
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidatePathStencilFunc(context, func, ref, mask)) if (!context->skipValidation() &&
!ValidatePathStencilFuncCHROMIUM(context, func, ref, mask))
{ {
return; return;
} }
...@@ -1495,7 +1428,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMo ...@@ -1495,7 +1428,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMo
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateStencilFillPath(context, path, fillMode, mask)) if (!context->skipValidation() &&
!ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask))
{ {
return; return;
} }
...@@ -1511,7 +1445,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint refer ...@@ -1511,7 +1445,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint refer
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilStrokePath(context, path, reference, mask)) !ValidateStencilStrokePathCHROMIUM(context, path, reference, mask))
{ {
return; return;
} }
...@@ -1526,7 +1460,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathCHROMIUM(GLuint path, GLenum coverMod ...@@ -1526,7 +1460,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathCHROMIUM(GLuint path, GLenum coverMod
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateCoverPath(context, path, coverMode)) if (!context->skipValidation() && !ValidateCoverPathCHROMIUM(context, path, coverMode))
{ {
return; return;
} }
...@@ -1541,7 +1475,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathCHROMIUM(GLuint path, GLenum coverM ...@@ -1541,7 +1475,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathCHROMIUM(GLuint path, GLenum coverM
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateCoverPath(context, path, coverMode)) if (!context->skipValidation() && !ValidateCoverPathCHROMIUM(context, path, coverMode))
{ {
return; return;
} }
...@@ -1561,7 +1495,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverFillPathCHROMIUM(GLuint path, ...@@ -1561,7 +1495,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverFillPathCHROMIUM(GLuint path,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilThenCoverFillPath(context, path, fillMode, mask, coverMode)) !ValidateStencilThenCoverFillPathCHROMIUM(context, path, fillMode, mask, coverMode))
{ {
return; return;
} }
...@@ -1581,7 +1515,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverStrokePathCHROMIUM(GLuint path, ...@@ -1581,7 +1515,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverStrokePathCHROMIUM(GLuint path,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilThenCoverStrokePath(context, path, reference, mask, coverMode)) !ValidateStencilThenCoverStrokePathCHROMIUM(context, path, reference, mask, coverMode))
{ {
return; return;
} }
...@@ -1606,8 +1540,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathInstancedCHROMIUM(GLsizei numPaths, ...@@ -1606,8 +1540,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() && !ValidateCoverFillPathInstancedCHROMIUM(
!ValidateCoverFillPathInstanced(context, numPaths, pathNameType, paths, pathBase, context, numPaths, pathNameType, paths, pathBase,
coverMode, transformType, transformValues)) coverMode, transformType, transformValues))
{ {
return; return;
...@@ -1634,8 +1568,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathInstancedCHROMIUM(GLsizei numPaths, ...@@ -1634,8 +1568,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() && !ValidateCoverStrokePathInstancedCHROMIUM(
!ValidateCoverStrokePathInstanced(context, numPaths, pathNameType, paths, pathBase, context, numPaths, pathNameType, paths, pathBase,
coverMode, transformType, transformValues)) coverMode, transformType, transformValues))
{ {
return; return;
...@@ -1663,8 +1597,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathInstancedCHROMIUM(GLsizei numPath ...@@ -1663,8 +1597,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathInstancedCHROMIUM(GLsizei numPath
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() && !ValidateStencilStrokePathInstancedCHROMIUM(
!ValidateStencilStrokePathInstanced(context, numPaths, pathNameType, paths, pathBase, context, numPaths, pathNameType, paths, pathBase,
reference, mask, transformType, transformValues)) reference, mask, transformType, transformValues))
{ {
return; return;
...@@ -1692,8 +1626,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathInstancedCHROMIUM(GLsizei numPaths, ...@@ -1692,8 +1626,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() && !ValidateStencilFillPathInstancedCHROMIUM(
!ValidateStencilFillPathInstanced(context, numPaths, pathNameType, paths, pathBase, context, numPaths, pathNameType, paths, pathBase,
fillMode, mask, transformType, transformValues)) fillMode, mask, transformType, transformValues))
{ {
return; return;
...@@ -1724,8 +1658,8 @@ StencilThenCoverFillPathInstancedCHROMIUM(GLsizei numPaths, ...@@ -1724,8 +1658,8 @@ StencilThenCoverFillPathInstancedCHROMIUM(GLsizei numPaths,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilThenCoverFillPathInstanced(context, numPaths, pathNameType, paths, !ValidateStencilThenCoverFillPathInstancedCHROMIUM(
pathBase, fillMode, mask, coverMode, context, numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode,
transformType, transformValues)) transformType, transformValues))
{ {
return; return;
...@@ -1759,8 +1693,8 @@ StencilThenCoverStrokePathInstancedCHROMIUM(GLsizei numPaths, ...@@ -1759,8 +1693,8 @@ StencilThenCoverStrokePathInstancedCHROMIUM(GLsizei numPaths,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateStencilThenCoverStrokePathInstanced(context, numPaths, pathNameType, paths, !ValidateStencilThenCoverStrokePathInstancedCHROMIUM(
pathBase, reference, mask, coverMode, context, numPaths, pathNameType, paths, pathBase, reference, mask, coverMode,
transformType, transformValues)) transformType, transformValues))
{ {
return; return;
...@@ -1782,7 +1716,7 @@ ANGLE_EXPORT void GL_APIENTRY BindFragmentInputLocationCHROMIUM(GLuint program, ...@@ -1782,7 +1716,7 @@ ANGLE_EXPORT void GL_APIENTRY BindFragmentInputLocationCHROMIUM(GLuint program,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateBindFragmentInputLocation(context, program, location, name)) !ValidateBindFragmentInputLocationCHROMIUM(context, program, location, name))
{ {
return; return;
} }
...@@ -1805,8 +1739,8 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program ...@@ -1805,8 +1739,8 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateProgramPathFragmentInputGen(context, program, location, genMode, components, !ValidateProgramPathFragmentInputGenCHROMIUM(context, program, location, genMode,
coeffs)) components, coeffs))
{ {
return; return;
} }
...@@ -1844,9 +1778,8 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId, ...@@ -1844,9 +1778,8 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
return; return;
} }
context->copyTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel, context->copyTexture(sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat,
internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha, destType, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
unpackUnmultiplyAlpha);
} }
} }
...@@ -1884,9 +1817,9 @@ ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId, ...@@ -1884,9 +1817,9 @@ ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
return; return;
} }
context->copySubTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel, context->copySubTexture(sourceId, sourceLevel, destTarget, destId, destLevel, xoffset,
xoffset, yoffset, x, y, width, height, unpackFlipY, yoffset, x, y, width, height, unpackFlipY, unpackPremultiplyAlpha,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha); unpackUnmultiplyAlpha);
} }
} }
...@@ -1903,7 +1836,7 @@ ANGLE_EXPORT void GL_APIENTRY CompressedCopyTextureCHROMIUM(GLuint sourceId, GLu ...@@ -1903,7 +1836,7 @@ ANGLE_EXPORT void GL_APIENTRY CompressedCopyTextureCHROMIUM(GLuint sourceId, GLu
return; return;
} }
context->compressedCopyTextureCHROMIUM(sourceId, destId); context->compressedCopyTexture(sourceId, destId);
} }
} }
......
...@@ -218,8 +218,8 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path, ...@@ -218,8 +218,8 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path,
const void *coords); const void *coords);
ANGLE_EXPORT void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value); ANGLE_EXPORT void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value);
ANGLE_EXPORT void GL_APIENTRY PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value); ANGLE_EXPORT void GL_APIENTRY PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value);
ANGLE_EXPORT void GL_APIENTRY GetPathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat *value); ANGLE_EXPORT void GL_APIENTRY GetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *value);
ANGLE_EXPORT void GL_APIENTRY GetPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint *value); ANGLE_EXPORT void GL_APIENTRY GetPathParameterivCHROMIUM(GLuint path, GLenum pname, GLint *value);
ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask); ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask);
ANGLE_EXPORT void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask); ANGLE_EXPORT void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask);
ANGLE_EXPORT void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask); ANGLE_EXPORT void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask);
......
...@@ -1938,12 +1938,12 @@ void GL_APIENTRY glPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value ...@@ -1938,12 +1938,12 @@ void GL_APIENTRY glPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value
void GL_APIENTRY glGetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *value) void GL_APIENTRY glGetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *value)
{ {
gl::GetPathParameterfCHROMIUM(path, pname, value); gl::GetPathParameterfvCHROMIUM(path, pname, value);
} }
void GL_APIENTRY glGetPathParameterivCHROMIUM(GLuint path, GLenum pname, GLint *value) void GL_APIENTRY glGetPathParameterivCHROMIUM(GLuint path, GLenum pname, GLint *value)
{ {
gl::GetPathParameteriCHROMIUM(path, pname, value); gl::GetPathParameterivCHROMIUM(path, pname, value);
} }
void GL_APIENTRY glPathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) void GL_APIENTRY glPathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask)
......
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