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,
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)
{
......@@ -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)
{
......@@ -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)
{
mGLState.setPathStencilFunc(func, ref, mask);
......@@ -1840,7 +1854,17 @@ void Context::insertEventMarker(GLsizei length, const char *marker)
void Context::pushGroupMarker(GLsizei length, const char *marker)
{
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);
}
}
void Context::popGroupMarker()
......@@ -3424,7 +3448,7 @@ void Context::generateMipmap(GLenum target)
handleError(texture->generateMipmap(this));
}
void Context::copyTextureCHROMIUM(GLuint sourceId,
void Context::copyTexture(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
......@@ -3445,7 +3469,7 @@ void Context::copyTextureCHROMIUM(GLuint sourceId,
ConvertToBool(unpackUnmultiplyAlpha), sourceTexture));
}
void Context::copySubTextureCHROMIUM(GLuint sourceId,
void Context::copySubTexture(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
......@@ -3478,7 +3502,7 @@ void Context::copySubTextureCHROMIUM(GLuint sourceId,
ConvertToBool(unpackUnmultiplyAlpha), sourceTexture));
}
void Context::compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId)
void Context::compressedCopyTexture(GLuint sourceId, GLuint destId)
{
syncStateForTexImage();
......@@ -5748,4 +5772,45 @@ void Context::readnPixels(GLint x,
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
......@@ -106,8 +106,10 @@ class Context final : public ValidationContext
GLsizei numCoords,
GLenum coordType,
const void *coords);
void setPathParameterf(GLuint path, GLenum pname, GLfloat value);
void getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) const;
void pathParameterf(GLuint path, GLenum pname, GLfloat value);
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);
// Framebuffers are owned by the Context, so these methods do not pass through
......@@ -120,6 +122,8 @@ class Context final : public ValidationContext
void finishFenceNV(GLuint fence);
void getFenceivNV(GLuint fence, GLenum pname, GLint *params);
GLboolean isFenceNV(GLuint fence);
void setFenceNV(GLuint fence, GLenum condition);
GLboolean testFenceNV(GLuint fence);
void bindTexture(GLenum target, GLuint handle);
void bindReadFramebuffer(GLuint framebufferHandle);
......@@ -527,7 +531,7 @@ class Context final : public ValidationContext
GLenum format,
GLsizei imageSize,
const void *data);
void copyTextureCHROMIUM(GLuint sourceId,
void copyTexture(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
......@@ -537,7 +541,7 @@ class Context final : public ValidationContext
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void copySubTextureCHROMIUM(GLuint sourceId,
void copySubTexture(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
......@@ -551,7 +555,7 @@ class Context final : public ValidationContext
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId);
void compressedCopyTexture(GLuint sourceId, GLuint destId);
void generateMipmap(GLenum target);
......@@ -979,6 +983,8 @@ class Context final : public ValidationContext
GLenum type,
GLsizei bufSize,
void *data);
void eGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
void eGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
// Consumes the error.
void handleError(const Error &error) override;
......
......@@ -3167,8 +3167,15 @@ bool ValidateDiscardFramebufferBase(Context *context,
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)
{
return false;
......@@ -3184,8 +3191,15 @@ bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *
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)
{
return false;
......@@ -3199,9 +3213,7 @@ bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *ma
return true;
}
bool ValidateEGLImageTargetTexture2DOES(Context *context,
GLenum target,
egl::Image *image)
bool ValidateEGLImageTargetTexture2DOES(Context *context, GLenum target, GLeglImageOES image)
{
if (!context->getExtensions().eglImage && !context->getExtensions().eglImageExternal)
{
......@@ -3232,14 +3244,16 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
return false;
}
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(image))
if (!context->getCurrentDisplay()->isValidImage(imageObject))
{
context->handleError(InvalidValue() << "EGL image is not valid.");
return false;
}
if (image->getSamples() > 0)
if (imageObject->getSamples() > 0)
{
context->handleError(InvalidOperation()
<< "cannot create a 2D texture from a multisampled EGL image.");
......@@ -3247,7 +3261,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
}
const TextureCaps &textureCaps =
context->getTextureCaps().get(image->getFormat().info->sizedInternalFormat);
context->getTextureCaps().get(imageObject->getFormat().info->sizedInternalFormat);
if (!textureCaps.texturable)
{
context->handleError(InvalidOperation()
......@@ -3260,7 +3274,7 @@ bool ValidateEGLImageTargetTexture2DOES(Context *context,
bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
GLenum target,
egl::Image *image)
GLeglImageOES image)
{
if (!context->getExtensions().eglImage)
{
......@@ -3278,15 +3292,17 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
return false;
}
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
ASSERT(context->getCurrentDisplay());
if (!context->getCurrentDisplay()->isValidImage(image))
if (!context->getCurrentDisplay()->isValidImage(imageObject))
{
context->handleError(InvalidValue() << "EGL image is not valid.");
return false;
}
const TextureCaps &textureCaps =
context->getTextureCaps().get(image->getFormat().info->sizedInternalFormat);
context->getTextureCaps().get(imageObject->getFormat().info->sizedInternalFormat);
if (!textureCaps.renderable)
{
context->handleError(InvalidOperation()
......
......@@ -39,7 +39,6 @@ bool ValidTexture2DDestinationTarget(const ValidationContext *context, GLenum ta
bool ValidTexture3DDestinationTarget(const ValidationContext *context, GLenum target);
bool ValidTexLevelDestinationTarget(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 ValidImageSizeParameters(ValidationContext *context,
GLenum target,
......@@ -337,12 +336,10 @@ bool ValidateDiscardFramebufferBase(Context *context,
bool ValidateInsertEventMarkerEXT(Context *context, GLsizei length, const char *marker);
bool ValidatePushGroupMarkerEXT(Context *context, GLsizei length, const char *marker);
bool ValidateEGLImageTargetTexture2DOES(Context *context,
GLenum target,
egl::Image *image);
bool ValidateEGLImageTargetTexture2DOES(Context *context, GLenum target, GLeglImageOES image);
bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
GLenum target,
egl::Image *image);
GLeglImageOES image);
bool ValidateBindVertexArrayBase(Context *context, GLuint array);
......
......@@ -1002,6 +1002,21 @@ bool ValidateWebGLNameLength(ValidationContext *context, size_t length)
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
bool ValidateES2TexImageParameters(Context *context,
......@@ -3074,42 +3089,28 @@ bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components)
// 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;
}
if (matrix == nullptr)
{
context->handleError(InvalidOperation() << "Invalid matrix.");
return false;
}
return true;
}
bool ValidateMatrixMode(Context *context, GLenum matrixMode)
bool ValidateMatrixLoadIdentityCHROMIUM(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;
return ValidateMatrixMode(context, matrixMode);
}
bool ValidateGenPaths(Context *context, GLsizei range)
bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range)
{
if (!context->getExtensions().pathRendering)
{
......@@ -3134,7 +3135,7 @@ bool ValidateGenPaths(Context *context, GLsizei range)
return true;
}
bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range)
bool ValidateDeletePathsCHROMIUM(Context *context, GLuint path, GLsizei range)
{
if (!context->getExtensions().pathRendering)
{
......@@ -3161,7 +3162,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range)
return true;
}
bool ValidatePathCommands(Context *context,
bool ValidatePathCommandsCHROMIUM(Context *context,
GLuint path,
GLsizei numCommands,
const GLubyte *commands,
......@@ -3282,7 +3283,7 @@ bool ValidatePathCommands(Context *context,
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)
{
......@@ -3346,7 +3347,13 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
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)
{
......@@ -3382,7 +3389,13 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
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)
{
......@@ -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
// 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)
{
......@@ -3447,7 +3460,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
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)
{
......@@ -3463,7 +3476,7 @@ bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, G
return true;
}
bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
bool ValidateCoverPathCHROMIUM(Context *context, GLuint path, GLenum coverMode)
{
if (!context->getExtensions().pathRendering)
{
......@@ -3488,27 +3501,27 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
return true;
}
bool ValidateStencilThenCoverFillPath(Context *context,
bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path,
GLenum fillMode,
GLuint mask,
GLenum coverMode)
{
return ValidateStencilFillPath(context, path, fillMode, mask) &&
ValidateCoverPath(context, path, coverMode);
return ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask) &&
ValidateCoverPathCHROMIUM(context, path, coverMode);
}
bool ValidateStencilThenCoverStrokePath(Context *context,
bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLuint path,
GLint reference,
GLuint mask,
GLenum coverMode)
{
return ValidateStencilStrokePath(context, path, reference, mask) &&
ValidateCoverPath(context, path, coverMode);
return ValidateStencilStrokePathCHROMIUM(context, path, reference, mask) &&
ValidateCoverPathCHROMIUM(context, path, coverMode);
}
bool ValidateIsPath(Context *context)
bool ValidateIsPathCHROMIUM(Context *context)
{
if (!context->getExtensions().pathRendering)
{
......@@ -3518,7 +3531,7 @@ bool ValidateIsPath(Context *context)
return true;
}
bool ValidateCoverFillPathInstanced(Context *context,
bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3545,7 +3558,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
return true;
}
bool ValidateCoverStrokePathInstanced(Context *context,
bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3572,7 +3585,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
return true;
}
bool ValidateStencilFillPathInstanced(Context *context,
bool ValidateStencilFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3604,7 +3617,7 @@ bool ValidateStencilFillPathInstanced(Context *context,
return true;
}
bool ValidateStencilStrokePathInstanced(Context *context,
bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3623,7 +3636,7 @@ bool ValidateStencilStrokePathInstanced(Context *context,
return true;
}
bool ValidateStencilThenCoverFillPathInstanced(Context *context,
bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3667,7 +3680,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
return true;
}
bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -3696,7 +3709,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
return true;
}
bool ValidateBindFragmentInputLocation(Context *context,
bool ValidateBindFragmentInputLocationCHROMIUM(Context *context,
GLuint program,
GLint location,
const GLchar *name)
......@@ -3736,7 +3749,7 @@ bool ValidateBindFragmentInputLocation(Context *context,
return true;
}
bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateProgramPathFragmentInputGenCHROMIUM(Context *context,
GLuint program,
GLint location,
GLenum genMode,
......@@ -6495,4 +6508,142 @@ bool ValidateIsFenceNV(Context *context, GLuint fence)
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
......@@ -227,35 +227,40 @@ bool ValidateBindUniformLocationCHROMIUM(Context *context,
bool ValidateCoverageModulationCHROMIUM(Context *context, GLenum components);
// CHROMIUM_path_rendering
bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix);
bool ValidateMatrixMode(Context *context, GLenum matrixMode);
bool ValidateGenPaths(Context *context, GLsizei range);
bool ValidateDeletePaths(Context *context, GLuint first, GLsizei range);
bool ValidatePathCommands(Context *context,
bool ValidateMatrixLoadfCHROMIUM(Context *context, GLenum matrixMode, const GLfloat *matrix);
bool ValidateMatrixLoadIdentityCHROMIUM(Context *context, GLenum matrixMode);
bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range);
bool ValidateDeletePathsCHROMIUM(Context *context, GLuint first, GLsizei range);
bool ValidatePathCommandsCHROMIUM(Context *context,
GLuint path,
GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
const void *coords);
bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat value);
bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLfloat *value);
bool ValidatePathStencilFunc(Context *context, GLenum func, GLint ref, GLuint mask);
bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLuint mask);
bool ValidateStencilStrokePath(Context *context, GLuint path, GLint reference, GLuint mask);
bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode);
bool ValidateStencilThenCoverFillPath(Context *context,
bool ValidatePathParameterfCHROMIUM(Context *context, GLuint path, GLenum pname, GLfloat value);
bool ValidatePathParameteriCHROMIUM(Context *context, GLuint path, GLenum pname, GLint value);
bool ValidateGetPathParameterfvCHROMIUM(Context *context,
GLuint path,
GLenum pname,
GLfloat *value);
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,
GLenum fillMode,
GLuint mask,
GLenum coverMode);
bool ValidateStencilThenCoverStrokePath(Context *context,
bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLuint path,
GLint reference,
GLuint mask,
GLenum coverMode);
bool ValidateIsPath(Context *context);
bool ValidateCoverFillPathInstanced(Context *context,
bool ValidateIsPathCHROMIUM(Context *context);
bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -263,7 +268,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateCoverStrokePathInstanced(Context *context,
bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -271,7 +276,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateStencilFillPathInstanced(Context *context,
bool ValidateStencilFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -280,7 +285,7 @@ bool ValidateStencilFillPathInstanced(Context *context,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateStencilStrokePathInstanced(Context *context,
bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -289,7 +294,7 @@ bool ValidateStencilStrokePathInstanced(Context *context,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateStencilThenCoverFillPathInstanced(Context *context,
bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -299,7 +304,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
......@@ -309,11 +314,11 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
bool ValidateBindFragmentInputLocation(Context *context,
bool ValidateBindFragmentInputLocationCHROMIUM(Context *context,
GLuint program,
GLint location,
const GLchar *name);
bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateProgramPathFragmentInputGenCHROMIUM(Context *context,
GLuint program,
GLint location,
GLenum genMode,
......@@ -694,6 +699,27 @@ bool ValidateGetTranslatedShaderSourceANGLE(Context *context,
GLsizei *length,
GLchar *source);
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
......
......@@ -498,26 +498,12 @@ void GL_APIENTRY SetFenceNV(GLuint fence, GLenum condition)
Context *context = GetValidGlobalContext();
if (context)
{
if (condition != GL_ALL_COMPLETED_NV)
if (!context->skipValidation() && !ValidateSetFenceNV(context, fence, condition))
{
context->handleError(InvalidEnum());
return;
}
FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == nullptr)
{
context->handleError(InvalidOperation());
return;
}
Error error = fenceObject->set(condition);
if (error.isError())
{
context->handleError(error);
return;
}
context->setFenceNV(fence, condition);
}
}
......@@ -528,29 +514,12 @@ GLboolean GL_APIENTRY TestFenceNV(GLuint fence)
Context *context = GetValidGlobalContext();
if (context)
{
FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == nullptr)
if (!context->skipValidation() && !ValidateTestFenceNV(context, fence))
{
context->handleError(InvalidOperation());
return GL_TRUE;
}
if (fenceObject->isSet() != GL_TRUE)
{
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 context->testFenceNV(fence);
}
return GL_TRUE;
......@@ -567,22 +536,8 @@ TexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei wi
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->getExtensions().textureStorage)
{
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))
if (!context->skipValidation() &&
!ValidateTexStorage2DEXT(context, target, levels, internalformat, width, height))
{
return;
}
......@@ -598,36 +553,11 @@ void GL_APIENTRY VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->getExtensions().instancedArrays)
{
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)
if (!context->skipValidation() &&
!ValidateVertexAttribDivisorANGLE(context, index, divisor))
{
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;
}
}
context->vertexAttribDivisor(index, divisor);
}
......@@ -702,7 +632,19 @@ void GL_APIENTRY TexImage3DOES(GLenum target,
"GLenum format = 0x%X, GLenum type = 0x%x, const void* pixels = 0x%0.8p)",
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,
......@@ -881,15 +823,7 @@ void GL_APIENTRY InsertEventMarkerEXT(GLsizei length, const char *marker)
Context *context = GetValidGlobalContext();
if (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
context->handleError(InvalidOperation() << "Extension not enabled");
return;
}
if (!ValidateInsertEventMarkerEXT(context, length, marker))
if (!context->skipValidation() && !ValidateInsertEventMarkerEXT(context, length, marker))
{
return;
}
......@@ -906,30 +840,13 @@ void GL_APIENTRY PushGroupMarkerEXT(GLsizei length, const char *marker)
Context *context = GetValidGlobalContext();
if (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
context->handleError(InvalidOperation() << "Extension not enabled");
return;
}
if (!ValidatePushGroupMarkerEXT(context, length, marker))
if (!context->skipValidation() && !ValidatePushGroupMarkerEXT(context, length, marker))
{
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);
}
}
}
void GL_APIENTRY PopGroupMarkerEXT()
......@@ -940,11 +857,8 @@ void GL_APIENTRY PopGroupMarkerEXT()
Context *context = GetValidGlobalContext();
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;
}
......@@ -959,19 +873,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetTexture2DOES(GLenum target, GLeglIma
Context *context = GetValidGlobalContext();
if (context)
{
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
if (!ValidateEGLImageTargetTexture2DOES(context, target, imageObject))
if (!context->skipValidation() &&
!ValidateEGLImageTargetTexture2DOES(context, target, image))
{
return;
}
Texture *texture = context->getTargetTexture(target);
Error error = texture->setEGLImageTarget(context, target, imageObject);
if (error.isError())
{
context->handleError(error);
return;
}
context->eGLImageTargetTexture2DOES(target, image);
}
}
......@@ -983,19 +891,13 @@ ANGLE_EXPORT void GL_APIENTRY EGLImageTargetRenderbufferStorageOES(GLenum target
Context *context = GetValidGlobalContext();
if (context)
{
egl::Image *imageObject = reinterpret_cast<egl::Image *>(image);
if (!ValidateEGLImageTargetRenderbufferStorageOES(context, target, imageObject))
if (!context->skipValidation() &&
!ValidateEGLImageTargetRenderbufferStorageOES(context, target, image))
{
return;
}
Renderbuffer *renderbuffer = context->getGLState().getCurrentRenderbuffer();
Error error = renderbuffer->setStorageEGLImageTarget(context, imageObject);
if (error.isError())
{
context->handleError(error);
return;
}
context->eGLImageTargetRenderbufferStorageOES(target, image);
}
}
......@@ -1080,7 +982,8 @@ void GL_APIENTRY DebugMessageControlKHR(GLenum source,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled))
if (!context->skipValidation() &&
!ValidateDebugMessageControlKHR(context, source, type, severity, count, ids, enabled))
{
return;
}
......@@ -1104,7 +1007,8 @@ void GL_APIENTRY DebugMessageInsertKHR(GLenum source,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf))
if (!context->skipValidation() &&
!ValidateDebugMessageInsertKHR(context, source, type, id, severity, length, buf))
{
return;
}
......@@ -1121,7 +1025,8 @@ void GL_APIENTRY DebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void *us
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateDebugMessageCallbackKHR(context, callback, userParam))
if (!context->skipValidation() &&
!ValidateDebugMessageCallbackKHR(context, callback, userParam))
{
return;
}
......@@ -1148,7 +1053,8 @@ GLuint GL_APIENTRY GetDebugMessageLogKHR(GLuint count,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types, ids, severities,
if (!context->skipValidation() &&
!ValidateGetDebugMessageLogKHR(context, count, bufSize, sources, types, ids, severities,
lengths, messageLog))
{
return 0;
......@@ -1171,7 +1077,8 @@ void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, con
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidatePushDebugGroupKHR(context, source, id, length, message))
if (!context->skipValidation() &&
!ValidatePushDebugGroupKHR(context, source, id, length, message))
{
return;
}
......@@ -1188,7 +1095,7 @@ void GL_APIENTRY PopDebugGroupKHR(void)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidatePopDebugGroupKHR(context))
if (!context->skipValidation() && !ValidatePopDebugGroupKHR(context))
{
return;
}
......@@ -1207,7 +1114,8 @@ void GL_APIENTRY ObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateObjectLabelKHR(context, identifier, name, length, label))
if (!context->skipValidation() &&
!ValidateObjectLabelKHR(context, identifier, name, length, label))
{
return;
}
......@@ -1227,7 +1135,8 @@ GetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *leng
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label))
if (!context->skipValidation() &&
!ValidateGetObjectLabelKHR(context, identifier, name, bufSize, length, label))
{
return;
}
......@@ -1244,7 +1153,7 @@ void GL_APIENTRY ObjectPtrLabelKHR(const void *ptr, GLsizei length, const GLchar
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateObjectPtrLabelKHR(context, ptr, length, label))
if (!context->skipValidation() && !ValidateObjectPtrLabelKHR(context, ptr, length, label))
{
return;
}
......@@ -1266,7 +1175,8 @@ void GL_APIENTRY GetObjectPtrLabelKHR(const void *ptr,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label))
if (!context->skipValidation() &&
!ValidateGetObjectPtrLabelKHR(context, ptr, bufSize, length, label))
{
return;
}
......@@ -1282,7 +1192,7 @@ void GL_APIENTRY GetPointervKHR(GLenum pname, void **params)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateGetPointervKHR(context, pname, params))
if (!context->skipValidation() && !ValidateGetPointervKHR(context, pname, params))
{
return;
}
......@@ -1301,7 +1211,8 @@ ANGLE_EXPORT void GL_APIENTRY BindUniformLocationCHROMIUM(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateBindUniformLocationCHROMIUM(context, program, location, name))
if (!context->skipValidation() &&
!ValidateBindUniformLocationCHROMIUM(context, program, location, name))
{
return;
}
......@@ -1317,7 +1228,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverageModulationCHROMIUM(GLenum components)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidateCoverageModulationCHROMIUM(context, components))
if (!context->skipValidation() && !ValidateCoverageModulationCHROMIUM(context, components))
{
return;
}
......@@ -1333,7 +1244,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadfCHROMIUM(GLenum matrixMode, const GLflo
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateMatrix(context, matrixMode, matrix))
if (!context->skipValidation() && !ValidateMatrixLoadfCHROMIUM(context, matrixMode, matrix))
{
return;
}
......@@ -1348,7 +1259,7 @@ ANGLE_EXPORT void GL_APIENTRY MatrixLoadIdentityCHROMIUM(GLenum matrixMode)
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateMatrixMode(context, matrixMode))
if (!context->skipValidation() && !ValidateMatrixLoadIdentityCHROMIUM(context, matrixMode))
{
return;
}
......@@ -1363,7 +1274,7 @@ ANGLE_EXPORT GLuint GL_APIENTRY GenPathsCHROMIUM(GLsizei range)
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateGenPaths(context, range))
if (!context->skipValidation() && !ValidateGenPathsCHROMIUM(context, range))
{
return 0;
}
......@@ -1379,7 +1290,7 @@ ANGLE_EXPORT void GL_APIENTRY DeletePathsCHROMIUM(GLuint first, GLsizei range)
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateDeletePaths(context, first, range))
if (!context->skipValidation() && !ValidateDeletePathsCHROMIUM(context, first, range))
{
return;
}
......@@ -1394,7 +1305,7 @@ ANGLE_EXPORT GLboolean GL_APIENTRY IsPathCHROMIUM(GLuint path)
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateIsPath(context))
if (!context->skipValidation() && !ValidateIsPathCHROMIUM(context))
{
return GL_FALSE;
}
......@@ -1418,14 +1329,12 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
if (!ValidatePathCommands(context, path, numCommands, commands, numCoords, coordType,
coords))
if (!context->skipValidation() &&
!ValidatePathCommandsCHROMIUM(context, path, numCommands, commands, numCoords,
coordType, coords))
{
return;
}
}
context->setPathCommands(path, numCommands, commands, numCoords, coordType, coords);
}
}
......@@ -1437,27 +1346,42 @@ ANGLE_EXPORT void GL_APIENTRY PathParameterfCHROMIUM(GLuint path, GLenum pname,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateSetPathParameter(context, path, pname, value))
if (!context->skipValidation() &&
!ValidatePathParameterfCHROMIUM(context, path, pname, value))
{
return;
}
context->setPathParameterf(path, pname, value);
context->pathParameterf(path, pname, 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();
if (context)
{
if (!context->skipValidation() && !ValidateGetPathParameter(context, path, pname, value))
if (!context->skipValidation() &&
!ValidateGetPathParameterfvCHROMIUM(context, path, pname, value))
{
return;
}
......@@ -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;
GetPathParameterfCHROMIUM(path, pname, value != nullptr ? &val : nullptr);
if (value)
*value = static_cast<GLint>(val);
EVENT("(GLuint path = %u, GLenum pname = %u, GLint *value = %p)", path, pname, value);
Context *context = GetValidGlobalContext();
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)
......@@ -1480,7 +1412,8 @@ ANGLE_EXPORT void GL_APIENTRY PathStencilFuncCHROMIUM(GLenum func, GLint ref, GL
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidatePathStencilFunc(context, func, ref, mask))
if (!context->skipValidation() &&
!ValidatePathStencilFuncCHROMIUM(context, func, ref, mask))
{
return;
}
......@@ -1495,7 +1428,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathCHROMIUM(GLuint path, GLenum fillMo
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateStencilFillPath(context, path, fillMode, mask))
if (!context->skipValidation() &&
!ValidateStencilFillPathCHROMIUM(context, path, fillMode, mask))
{
return;
}
......@@ -1511,7 +1445,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathCHROMIUM(GLuint path, GLint refer
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilStrokePath(context, path, reference, mask))
!ValidateStencilStrokePathCHROMIUM(context, path, reference, mask))
{
return;
}
......@@ -1526,7 +1460,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathCHROMIUM(GLuint path, GLenum coverMod
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateCoverPath(context, path, coverMode))
if (!context->skipValidation() && !ValidateCoverPathCHROMIUM(context, path, coverMode))
{
return;
}
......@@ -1541,7 +1475,7 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathCHROMIUM(GLuint path, GLenum coverM
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateCoverPath(context, path, coverMode))
if (!context->skipValidation() && !ValidateCoverPathCHROMIUM(context, path, coverMode))
{
return;
}
......@@ -1561,7 +1495,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverFillPathCHROMIUM(GLuint path,
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilThenCoverFillPath(context, path, fillMode, mask, coverMode))
!ValidateStencilThenCoverFillPathCHROMIUM(context, path, fillMode, mask, coverMode))
{
return;
}
......@@ -1581,7 +1515,7 @@ ANGLE_EXPORT void GL_APIENTRY StencilThenCoverStrokePathCHROMIUM(GLuint path,
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilThenCoverStrokePath(context, path, reference, mask, coverMode))
!ValidateStencilThenCoverStrokePathCHROMIUM(context, path, reference, mask, coverMode))
{
return;
}
......@@ -1606,8 +1540,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverFillPathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCoverFillPathInstanced(context, numPaths, pathNameType, paths, pathBase,
if (!context->skipValidation() && !ValidateCoverFillPathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase,
coverMode, transformType, transformValues))
{
return;
......@@ -1634,8 +1568,8 @@ ANGLE_EXPORT void GL_APIENTRY CoverStrokePathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCoverStrokePathInstanced(context, numPaths, pathNameType, paths, pathBase,
if (!context->skipValidation() && !ValidateCoverStrokePathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase,
coverMode, transformType, transformValues))
{
return;
......@@ -1663,8 +1597,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilStrokePathInstancedCHROMIUM(GLsizei numPath
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilStrokePathInstanced(context, numPaths, pathNameType, paths, pathBase,
if (!context->skipValidation() && !ValidateStencilStrokePathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase,
reference, mask, transformType, transformValues))
{
return;
......@@ -1692,8 +1626,8 @@ ANGLE_EXPORT void GL_APIENTRY StencilFillPathInstancedCHROMIUM(GLsizei numPaths,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilFillPathInstanced(context, numPaths, pathNameType, paths, pathBase,
if (!context->skipValidation() && !ValidateStencilFillPathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase,
fillMode, mask, transformType, transformValues))
{
return;
......@@ -1724,8 +1658,8 @@ StencilThenCoverFillPathInstancedCHROMIUM(GLsizei numPaths,
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilThenCoverFillPathInstanced(context, numPaths, pathNameType, paths,
pathBase, fillMode, mask, coverMode,
!ValidateStencilThenCoverFillPathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode,
transformType, transformValues))
{
return;
......@@ -1759,8 +1693,8 @@ StencilThenCoverStrokePathInstancedCHROMIUM(GLsizei numPaths,
if (context)
{
if (!context->skipValidation() &&
!ValidateStencilThenCoverStrokePathInstanced(context, numPaths, pathNameType, paths,
pathBase, reference, mask, coverMode,
!ValidateStencilThenCoverStrokePathInstancedCHROMIUM(
context, numPaths, pathNameType, paths, pathBase, reference, mask, coverMode,
transformType, transformValues))
{
return;
......@@ -1782,7 +1716,7 @@ ANGLE_EXPORT void GL_APIENTRY BindFragmentInputLocationCHROMIUM(GLuint program,
if (context)
{
if (!context->skipValidation() &&
!ValidateBindFragmentInputLocation(context, program, location, name))
!ValidateBindFragmentInputLocationCHROMIUM(context, program, location, name))
{
return;
}
......@@ -1805,8 +1739,8 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramPathFragmentInputGen(context, program, location, genMode, components,
coeffs))
!ValidateProgramPathFragmentInputGenCHROMIUM(context, program, location, genMode,
components, coeffs))
{
return;
}
......@@ -1844,9 +1778,8 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
return;
}
context->copyTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
context->copyTexture(sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat,
destType, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
}
......@@ -1884,9 +1817,9 @@ ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
return;
}
context->copySubTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
xoffset, yoffset, x, y, width, height, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
context->copySubTexture(sourceId, sourceLevel, destTarget, destId, destLevel, xoffset,
yoffset, x, y, width, height, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
}
}
......@@ -1903,7 +1836,7 @@ ANGLE_EXPORT void GL_APIENTRY CompressedCopyTextureCHROMIUM(GLuint sourceId, GLu
return;
}
context->compressedCopyTextureCHROMIUM(sourceId, destId);
context->compressedCopyTexture(sourceId, destId);
}
}
......
......@@ -218,8 +218,8 @@ ANGLE_EXPORT void GL_APIENTRY PathCommandsCHROMIUM(GLuint path,
const void *coords);
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 GetPathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat *value);
ANGLE_EXPORT void GL_APIENTRY GetPathParameteriCHROMIUM(GLuint path, GLenum pname, GLint *value);
ANGLE_EXPORT void GL_APIENTRY GetPathParameterfvCHROMIUM(GLuint path, GLenum pname, GLfloat *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 StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, 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
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)
{
gl::GetPathParameteriCHROMIUM(path, pname, value);
gl::GetPathParameterivCHROMIUM(path, pname, value);
}
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