Commit 7b5744f4 by Jiacheng Lu Committed by Commit Bot

Use PathID in place of GLuint handle

Bug: angleproject:3804 Change-Id: Ibadfc2c33e4af1cca22caa1dbe96ac48a4a85ffa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1766822Reviewed-by: 's avatarJiacheng Lu <lujc@google.com> Commit-Queue: Jiacheng Lu <lujc@google.com>
parent 83785d06
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf", "fc2e249239fb1365f6d145cdf1a3cfcf",
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"214f06af8a4b23f0a281fae2a419872b", "1b2296fde1340820b7ff94b2ff656363",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"00dc8410ad87e122314ac58579445188", "00dc8410ad87e122314ac58579445188",
"scripts/gl.xml": "scripts/gl.xml":
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"src/libANGLE/Context_gles_3_1_autogen.h": "src/libANGLE/Context_gles_3_1_autogen.h":
"f896134a6354cc9c87620c864d90367b", "f896134a6354cc9c87620c864d90367b",
"src/libANGLE/Context_gles_ext_autogen.h": "src/libANGLE/Context_gles_ext_autogen.h":
"cf7cc214a7d97ffafcbb6ca3df39830d", "cf5501e3d41f2591e3856bcdfe75154f",
"src/libANGLE/capture_gles_1_0_autogen.cpp": "src/libANGLE/capture_gles_1_0_autogen.cpp":
"f4e1335bebff584d2ac5198571b19972", "f4e1335bebff584d2ac5198571b19972",
"src/libANGLE/capture_gles_1_0_autogen.h": "src/libANGLE/capture_gles_1_0_autogen.h":
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
"src/libANGLE/capture_gles_3_1_autogen.h": "src/libANGLE/capture_gles_3_1_autogen.h":
"74352d1f4cfee29d5910213bbb91ff58", "74352d1f4cfee29d5910213bbb91ff58",
"src/libANGLE/capture_gles_ext_autogen.cpp": "src/libANGLE/capture_gles_ext_autogen.cpp":
"aa29ead7d7618eb5cf81727f8c9cb7ec", "6031a345d1c2f30eb5cef311e9c0c240",
"src/libANGLE/capture_gles_ext_autogen.h": "src/libANGLE/capture_gles_ext_autogen.h":
"bcff5309d0a39d162c3c114af0ba0899", "aee88bb5ce039fddef9f0e2c348fd0a5",
"src/libANGLE/entry_points_enum_autogen.cpp": "src/libANGLE/entry_points_enum_autogen.cpp":
"97b5fe98b95b4ae36c68f723e64f993a", "97b5fe98b95b4ae36c68f723e64f993a",
"src/libANGLE/entry_points_enum_autogen.h": "src/libANGLE/entry_points_enum_autogen.h":
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
"src/libANGLE/frame_capture_replay_autogen.cpp": "src/libANGLE/frame_capture_replay_autogen.cpp":
"dbb3b97a92642d7ae1cc236bcfcc026e", "dbb3b97a92642d7ae1cc236bcfcc026e",
"src/libANGLE/frame_capture_utils_autogen.cpp": "src/libANGLE/frame_capture_utils_autogen.cpp":
"3ba517eb7c220c22ebf23797448993f7", "91c6cf1ca72529b8566fcb2701d4af54",
"src/libANGLE/frame_capture_utils_autogen.h": "src/libANGLE/frame_capture_utils_autogen.h":
"e0e8e0d9246ea7962bdadba90fdd7201", "d91d526ee7ba3f9faa46b372e5d1f451",
"src/libANGLE/validationES1_autogen.h": "src/libANGLE/validationES1_autogen.h":
"8d3131d2bf2e6f521f46b44e64a6bff9", "8d3131d2bf2e6f521f46b44e64a6bff9",
"src/libANGLE/validationES2_autogen.h": "src/libANGLE/validationES2_autogen.h":
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
"src/libANGLE/validationES3_autogen.h": "src/libANGLE/validationES3_autogen.h":
"9eab21999d1a7ef3ffb1910a551188f4", "9eab21999d1a7ef3ffb1910a551188f4",
"src/libANGLE/validationESEXT_autogen.h": "src/libANGLE/validationESEXT_autogen.h":
"7fc3c4a80ca3b9a938cdb39d96bf9036", "fc56ac5442dcc5d529a59c684f98d077",
"src/libANGLE/validationGL11_autogen.h": "src/libANGLE/validationGL11_autogen.h":
"c5ac1ca523a39df2621d11e92c9c821a", "c5ac1ca523a39df2621d11e92c9c821a",
"src/libANGLE/validationGL12_autogen.h": "src/libANGLE/validationGL12_autogen.h":
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
"src/libGLESv2/entry_points_gles_3_1_autogen.h": "src/libGLESv2/entry_points_gles_3_1_autogen.h":
"043d09a964c740067bf4279e0b544aed", "043d09a964c740067bf4279e0b544aed",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp": "src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"a79a50a023864dfdb77d3178423cf527", "c5a5397e8b905e550716e821c0c0c88e",
"src/libGLESv2/entry_points_gles_ext_autogen.h": "src/libGLESv2/entry_points_gles_ext_autogen.h":
"fea36fa137e55dd2f244dbb49d31cc41", "fea36fa137e55dd2f244dbb49d31cc41",
"src/libGLESv2/libGLESv2_autogen.cpp": "src/libGLESv2/libGLESv2_autogen.cpp":
......
...@@ -917,5 +917,129 @@ ...@@ -917,5 +917,129 @@
}, },
"glGetQueryObjectuivRobust": { "glGetQueryObjectuivRobust": {
"id": "QueryID" "id": "QueryID"
},
"glDeletePaths": {
"first": "PathID"
},
"glIsPath": {
"path": "PathID"
},
"glPathCommands": {
"path": "PathID"
},
"glPathCoords": {
"path": "PathID"
},
"glPathSubCommands": {
"path": "PathID"
},
"glPathSubCoords": {
"path": "PathID"
},
"glPathString": {
"path": "PathID"
},
"glPathGlyphs": {
"pathParameterTemplate": "PathID"
},
"glPathGlyphRange": {
"pathParameterTemplate": "PathID"
},
"glInterpolatePaths": {
"pathA": "PathID",
"pathB": "PathID"
},
"glPathParameteriv": {
"path": "PathID"
},
"glPathParameteri": {
"path": "PathID"
},
"glPathParameterfv": {
"path": "PathID"
},
"glPathParameterf": {
"path": "PathID"
},
"glPathDashArray": {
"path": "PathID"
},
"glStencilStrokePath": {
"path": "PathID"
},
"glStencilFillPath": {
"path": "PathID"
},
"glStencilFillPathInstanced": {
"pathBase": "PathID"
},
"glStencilStrokePathInstanced": {
"pathBase": "PathID"
},
"glCoverFillPath": {
"path": "PathID"
},
"glCoverStrokePath": {
"path": "PathID"
},
"glCoverFillPathInstanced": {
"pathBase": "PathID"
},
"glCoverStrokePathInstanced": {
"pathBase": "PathID"
},
"glGetPathParameteriv": {
"path": "PathID"
},
"glGetPathParameterfv": {
"path": "PathID"
},
"glGetPathCommands": {
"path": "PathID"
},
"glGetPathCoords": {
"path": "PathID"
},
"glGetPathDashArray": {
"path": "PathID"
},
"glGetPathMetrics": {
"pathBase": "PathID"
},
"glGetPathSpacing": {
"pathBase": "PathID"
},
"glIsPointInFillPath": {
"path": "PathID"
},
"glIsPointInStrokePath": {
"path": "PathID"
},
"glGetPathLength": {
"path": "PathID"
},
"glPointAlongPath": {
"path": "PathID"
},
"glStencilThenCoverFillPath": {
"path": "PathID"
},
"glStencilThenCoverStrokePath": {
"path": "PathID"
},
"glStencilThenCoverFillPathInstanced": {
"pathBase": "PathID"
},
"glStencilThenCoverStrokePathInstanced": {
"pathBase": "PathID"
},
"glPathGlyphIndexRange": {
"path": "PathID"
},
"glPathGlyphIndexArray": {
"path": "PathID"
},
"glPathMemoryGlyphIndexArray": {
"path": "PathID"
} }
} }
...@@ -386,6 +386,11 @@ struct RenderbufferID ...@@ -386,6 +386,11 @@ struct RenderbufferID
GLuint value; GLuint value;
}; };
struct PathID
{
GLuint value;
};
struct TextureID struct TextureID
{ {
GLuint value; GLuint value;
......
...@@ -61,7 +61,7 @@ template <typename T> ...@@ -61,7 +61,7 @@ template <typename T>
std::vector<Path *> GatherPaths(PathManager &resourceManager, std::vector<Path *> GatherPaths(PathManager &resourceManager,
GLsizei numPaths, GLsizei numPaths,
const void *paths, const void *paths,
GLuint pathBase) PathID pathBase)
{ {
std::vector<Path *> ret; std::vector<Path *> ret;
ret.reserve(numPaths); ret.reserve(numPaths);
...@@ -70,9 +70,9 @@ std::vector<Path *> GatherPaths(PathManager &resourceManager, ...@@ -70,9 +70,9 @@ std::vector<Path *> GatherPaths(PathManager &resourceManager,
for (GLsizei i = 0; i < numPaths; ++i) for (GLsizei i = 0; i < numPaths; ++i)
{ {
const GLuint pathName = nameArray[i] + pathBase; const GLuint pathName = nameArray[i] + pathBase.value;
ret.push_back(resourceManager.getPath(pathName)); ret.push_back(resourceManager.getPath({pathName}));
} }
return ret; return ret;
...@@ -82,7 +82,7 @@ std::vector<Path *> GatherPaths(PathManager &resourceManager, ...@@ -82,7 +82,7 @@ std::vector<Path *> GatherPaths(PathManager &resourceManager,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase) PathID pathBase)
{ {
switch (pathNameType) switch (pathNameType)
{ {
...@@ -702,16 +702,16 @@ RenderbufferID Context::createRenderbuffer() ...@@ -702,16 +702,16 @@ RenderbufferID Context::createRenderbuffer()
return mState.mRenderbufferManager->createRenderbuffer(); return mState.mRenderbufferManager->createRenderbuffer();
} }
void Context::tryGenPaths(GLsizei range, GLuint *createdOut) void Context::tryGenPaths(GLsizei range, PathID *createdOut)
{ {
ANGLE_CONTEXT_TRY(mState.mPathManager->createPaths(this, range, createdOut)); ANGLE_CONTEXT_TRY(mState.mPathManager->createPaths(this, range, createdOut));
} }
GLuint Context::genPaths(GLsizei range) GLuint Context::genPaths(GLsizei range)
{ {
GLuint created = 0; PathID created = {0};
tryGenPaths(range, &created); tryGenPaths(range, &created);
return created; return created.value;
} }
// Returns an unused framebuffer name // Returns an unused framebuffer name
...@@ -821,12 +821,12 @@ void Context::deleteSemaphore(GLuint semaphore) ...@@ -821,12 +821,12 @@ void Context::deleteSemaphore(GLuint semaphore)
mState.mSemaphoreManager->deleteSemaphore(this, semaphore); mState.mSemaphoreManager->deleteSemaphore(this, semaphore);
} }
void Context::deletePaths(GLuint first, GLsizei range) void Context::deletePaths(PathID first, GLsizei range)
{ {
mState.mPathManager->deletePaths(first, range); mState.mPathManager->deletePaths(first, range);
} }
GLboolean Context::isPath(GLuint path) GLboolean Context::isPath(PathID path)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (pathObj == nullptr) if (pathObj == nullptr)
...@@ -835,12 +835,12 @@ GLboolean Context::isPath(GLuint path) ...@@ -835,12 +835,12 @@ GLboolean Context::isPath(GLuint path)
return pathObj->hasPathData(); return pathObj->hasPathData();
} }
bool Context::isPathGenerated(GLuint path) const bool Context::isPathGenerated(PathID path) const
{ {
return mState.mPathManager->hasPath(path); return mState.mPathManager->hasPath(path);
} }
void Context::pathCommands(GLuint path, void Context::pathCommands(PathID path,
GLsizei numCommands, GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
...@@ -852,7 +852,7 @@ void Context::pathCommands(GLuint path, ...@@ -852,7 +852,7 @@ void Context::pathCommands(GLuint path,
ANGLE_CONTEXT_TRY(pathObject->setCommands(numCommands, commands, numCoords, coordType, coords)); ANGLE_CONTEXT_TRY(pathObject->setCommands(numCommands, commands, numCoords, coordType, coords));
} }
void Context::pathParameterf(GLuint path, GLenum pname, GLfloat value) void Context::pathParameterf(PathID path, GLenum pname, GLfloat value)
{ {
Path *pathObj = mState.mPathManager->getPath(path); Path *pathObj = mState.mPathManager->getPath(path);
...@@ -879,13 +879,13 @@ void Context::pathParameterf(GLuint path, GLenum pname, GLfloat value) ...@@ -879,13 +879,13 @@ void Context::pathParameterf(GLuint path, GLenum pname, GLfloat value)
} }
} }
void Context::pathParameteri(GLuint path, GLenum pname, GLint value) void Context::pathParameteri(PathID path, GLenum pname, GLint value)
{ {
// TODO(jmadill): Should use proper clamping/casting. // TODO(jmadill): Should use proper clamping/casting.
pathParameterf(path, pname, static_cast<GLfloat>(value)); pathParameterf(path, pname, static_cast<GLfloat>(value));
} }
void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) void Context::getPathParameterfv(PathID path, GLenum pname, GLfloat *value)
{ {
const Path *pathObj = mState.mPathManager->getPath(path); const Path *pathObj = mState.mPathManager->getPath(path);
...@@ -912,7 +912,7 @@ void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value) ...@@ -912,7 +912,7 @@ void Context::getPathParameterfv(GLuint path, GLenum pname, GLfloat *value)
} }
} }
void Context::getPathParameteriv(GLuint path, GLenum pname, GLint *value) void Context::getPathParameteriv(PathID path, GLenum pname, GLint *value)
{ {
GLfloat val = 0.0f; GLfloat val = 0.0f;
getPathParameterfv(path, pname, value != nullptr ? &val : nullptr); getPathParameterfv(path, pname, value != nullptr ? &val : nullptr);
...@@ -2367,7 +2367,7 @@ void Context::matrixLoadIdentity(GLenum matrixMode) ...@@ -2367,7 +2367,7 @@ void Context::matrixLoadIdentity(GLenum matrixMode)
mState.loadPathRenderingMatrix(matrixMode, I); mState.loadPathRenderingMatrix(matrixMode, I);
} }
void Context::stencilFillPath(GLuint path, GLenum fillMode, GLuint mask) void Context::stencilFillPath(PathID path, GLenum fillMode, GLuint mask)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (!pathObj) if (!pathObj)
...@@ -2378,7 +2378,7 @@ void Context::stencilFillPath(GLuint path, GLenum fillMode, GLuint mask) ...@@ -2378,7 +2378,7 @@ void Context::stencilFillPath(GLuint path, GLenum fillMode, GLuint mask)
mImplementation->stencilFillPath(pathObj, fillMode, mask); mImplementation->stencilFillPath(pathObj, fillMode, mask);
} }
void Context::stencilStrokePath(GLuint path, GLint reference, GLuint mask) void Context::stencilStrokePath(PathID path, GLint reference, GLuint mask)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (!pathObj) if (!pathObj)
...@@ -2389,7 +2389,7 @@ void Context::stencilStrokePath(GLuint path, GLint reference, GLuint mask) ...@@ -2389,7 +2389,7 @@ void Context::stencilStrokePath(GLuint path, GLint reference, GLuint mask)
mImplementation->stencilStrokePath(pathObj, reference, mask); mImplementation->stencilStrokePath(pathObj, reference, mask);
} }
void Context::coverFillPath(GLuint path, GLenum coverMode) void Context::coverFillPath(PathID path, GLenum coverMode)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (!pathObj) if (!pathObj)
...@@ -2400,7 +2400,7 @@ void Context::coverFillPath(GLuint path, GLenum coverMode) ...@@ -2400,7 +2400,7 @@ void Context::coverFillPath(GLuint path, GLenum coverMode)
mImplementation->coverFillPath(pathObj, coverMode); mImplementation->coverFillPath(pathObj, coverMode);
} }
void Context::coverStrokePath(GLuint path, GLenum coverMode) void Context::coverStrokePath(PathID path, GLenum coverMode)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (!pathObj) if (!pathObj)
...@@ -2411,7 +2411,7 @@ void Context::coverStrokePath(GLuint path, GLenum coverMode) ...@@ -2411,7 +2411,7 @@ void Context::coverStrokePath(GLuint path, GLenum coverMode)
mImplementation->coverStrokePath(pathObj, coverMode); mImplementation->coverStrokePath(pathObj, coverMode);
} }
void Context::stencilThenCoverFillPath(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode) void Context::stencilThenCoverFillPath(PathID path, GLenum fillMode, GLuint mask, GLenum coverMode)
{ {
const auto *pathObj = mState.mPathManager->getPath(path); const auto *pathObj = mState.mPathManager->getPath(path);
if (!pathObj) if (!pathObj)
...@@ -2422,7 +2422,7 @@ void Context::stencilThenCoverFillPath(GLuint path, GLenum fillMode, GLuint mask ...@@ -2422,7 +2422,7 @@ void Context::stencilThenCoverFillPath(GLuint path, GLenum fillMode, GLuint mask
mImplementation->stencilThenCoverFillPath(pathObj, fillMode, mask, coverMode); mImplementation->stencilThenCoverFillPath(pathObj, fillMode, mask, coverMode);
} }
void Context::stencilThenCoverStrokePath(GLuint path, void Context::stencilThenCoverStrokePath(PathID path,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode) GLenum coverMode)
...@@ -2439,7 +2439,7 @@ void Context::stencilThenCoverStrokePath(GLuint path, ...@@ -2439,7 +2439,7 @@ void Context::stencilThenCoverStrokePath(GLuint path,
void Context::coverFillPathInstanced(GLsizei numPaths, void Context::coverFillPathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues) const GLfloat *transformValues)
...@@ -2455,7 +2455,7 @@ void Context::coverFillPathInstanced(GLsizei numPaths, ...@@ -2455,7 +2455,7 @@ void Context::coverFillPathInstanced(GLsizei numPaths,
void Context::coverStrokePathInstanced(GLsizei numPaths, void Context::coverStrokePathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues) const GLfloat *transformValues)
...@@ -2473,7 +2473,7 @@ void Context::coverStrokePathInstanced(GLsizei numPaths, ...@@ -2473,7 +2473,7 @@ void Context::coverStrokePathInstanced(GLsizei numPaths,
void Context::stencilFillPathInstanced(GLsizei numPaths, void Context::stencilFillPathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -2492,7 +2492,7 @@ void Context::stencilFillPathInstanced(GLsizei numPaths, ...@@ -2492,7 +2492,7 @@ void Context::stencilFillPathInstanced(GLsizei numPaths,
void Context::stencilStrokePathInstanced(GLsizei numPaths, void Context::stencilStrokePathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -2510,7 +2510,7 @@ void Context::stencilStrokePathInstanced(GLsizei numPaths, ...@@ -2510,7 +2510,7 @@ void Context::stencilStrokePathInstanced(GLsizei numPaths,
void Context::stencilThenCoverFillPathInstanced(GLsizei numPaths, void Context::stencilThenCoverFillPathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
...@@ -2529,7 +2529,7 @@ void Context::stencilThenCoverFillPathInstanced(GLsizei numPaths, ...@@ -2529,7 +2529,7 @@ void Context::stencilThenCoverFillPathInstanced(GLsizei numPaths,
void Context::stencilThenCoverStrokePathInstanced(GLsizei numPaths, void Context::stencilThenCoverStrokePathInstanced(GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
......
...@@ -364,7 +364,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -364,7 +364,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
void deleteSemaphore(GLuint semaphore); void deleteSemaphore(GLuint semaphore);
// CHROMIUM_path_rendering // CHROMIUM_path_rendering
bool isPathGenerated(GLuint path) const; bool isPathGenerated(PathID path) const;
void bindReadFramebuffer(GLuint framebufferHandle); void bindReadFramebuffer(GLuint framebufferHandle);
void bindDrawFramebuffer(GLuint framebufferHandle); void bindDrawFramebuffer(GLuint framebufferHandle);
...@@ -603,7 +603,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -603,7 +603,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
void detachProgramPipeline(GLuint pipeline); void detachProgramPipeline(GLuint pipeline);
// A small helper method to facilitate using the ANGLE_CONTEXT_TRY macro. // A small helper method to facilitate using the ANGLE_CONTEXT_TRY macro.
void tryGenPaths(GLsizei range, GLuint *createdOut); void tryGenPaths(GLsizei range, PathID *createdOut);
egl::Error setDefaultFramebuffer(egl::Surface *surface); egl::Error setDefaultFramebuffer(egl::Surface *surface);
egl::Error unsetDefaultFramebuffer(); egl::Error unsetDefaultFramebuffer();
......
...@@ -224,41 +224,43 @@ ...@@ -224,41 +224,43 @@
void loseContext(GraphicsResetStatus currentPacked, GraphicsResetStatus otherPacked); \ void loseContext(GraphicsResetStatus currentPacked, GraphicsResetStatus otherPacked); \
/* GL_CHROMIUM_path_rendering */ \ /* GL_CHROMIUM_path_rendering */ \
GLuint genPaths(GLsizei range); \ GLuint genPaths(GLsizei range); \
void deletePaths(GLuint first, GLsizei range); \ void deletePaths(PathID firstPacked, GLsizei range); \
GLboolean isPath(GLuint path); \ GLboolean isPath(PathID pathPacked); \
void pathCommands(GLuint path, GLsizei numCommands, const GLubyte *commands, \ void pathCommands(PathID pathPacked, GLsizei numCommands, const GLubyte *commands, \
GLsizei numCoords, GLenum coordType, const void *coords); \ GLsizei numCoords, GLenum coordType, const void *coords); \
void pathParameterf(GLuint path, GLenum pname, GLfloat value); \ void pathParameterf(PathID pathPacked, GLenum pname, GLfloat value); \
void pathParameteri(GLuint path, GLenum pname, GLint value); \ void pathParameteri(PathID pathPacked, GLenum pname, GLint value); \
void getPathParameterfv(GLuint path, GLenum pname, GLfloat *value); \ void getPathParameterfv(PathID pathPacked, GLenum pname, GLfloat *value); \
void getPathParameteriv(GLuint path, GLenum pname, GLint *value); \ void getPathParameteriv(PathID pathPacked, GLenum pname, GLint *value); \
void pathStencilFunc(GLenum func, GLint ref, GLuint mask); \ void pathStencilFunc(GLenum func, GLint ref, GLuint mask); \
void stencilFillPath(GLuint path, GLenum fillMode, GLuint mask); \ void stencilFillPath(PathID pathPacked, GLenum fillMode, GLuint mask); \
void stencilStrokePath(GLuint path, GLint reference, GLuint mask); \ void stencilStrokePath(PathID pathPacked, GLint reference, GLuint mask); \
void coverFillPath(GLuint path, GLenum coverMode); \ void coverFillPath(PathID pathPacked, GLenum coverMode); \
void coverStrokePath(GLuint path, GLenum coverMode); \ void coverStrokePath(PathID pathPacked, GLenum coverMode); \
void stencilThenCoverFillPath(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); \ void stencilThenCoverFillPath(PathID pathPacked, GLenum fillMode, GLuint mask, \
void stencilThenCoverStrokePath(GLuint path, GLint reference, GLuint mask, GLenum coverMode); \ GLenum coverMode); \
void stencilThenCoverStrokePath(PathID pathPacked, GLint reference, GLuint mask, \
GLenum coverMode); \
void coverFillPathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \ void coverFillPathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \
GLuint pathBase, GLenum coverMode, GLenum transformType, \ PathID pathBasePacked, GLenum coverMode, GLenum transformType, \
const GLfloat *transformValues); \ const GLfloat *transformValues); \
void coverStrokePathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \ void coverStrokePathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \
GLuint pathBase, GLenum coverMode, GLenum transformType, \ PathID pathBasePacked, GLenum coverMode, GLenum transformType, \
const GLfloat *transformValues); \ const GLfloat *transformValues); \
void stencilStrokePathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \ void stencilStrokePathInstanced(GLsizei numPath, GLenum pathNameType, const void *paths, \
GLuint pathBase, GLint reference, GLuint mask, \ PathID pathBasePacked, GLint reference, GLuint mask, \
GLenum transformType, const GLfloat *transformValues); \ GLenum transformType, const GLfloat *transformValues); \
void stencilFillPathInstanced(GLsizei numPaths, GLenum pathNameType, const void *paths, \ void stencilFillPathInstanced(GLsizei numPaths, GLenum pathNameType, const void *paths, \
GLuint pathBase, GLenum fillMode, GLuint mask, \ PathID pathBasePacked, GLenum fillMode, GLuint mask, \
GLenum transformType, const GLfloat *transformValues); \ GLenum transformType, const GLfloat *transformValues); \
void stencilThenCoverFillPathInstanced(GLsizei numPaths, GLenum pathNameType, \ void stencilThenCoverFillPathInstanced(GLsizei numPaths, GLenum pathNameType, \
const void *paths, GLuint pathBase, GLenum fillMode, \ const void *paths, PathID pathBasePacked, \
GLuint mask, GLenum coverMode, GLenum transformType, \ GLenum fillMode, GLuint mask, GLenum coverMode, \
const GLfloat *transformValues); \ GLenum transformType, const GLfloat *transformValues); \
void stencilThenCoverStrokePathInstanced(GLsizei numPaths, GLenum pathNameType, \ void stencilThenCoverStrokePathInstanced( \
const void *paths, GLuint pathBase, GLint reference, \ GLsizei numPaths, GLenum pathNameType, const void *paths, PathID pathBasePacked, \
GLuint mask, GLenum coverMode, GLenum transformType, \ GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, \
const GLfloat *transformValues); \ const GLfloat *transformValues); \
void bindFragmentInputLocation(GLuint programs, GLint location, const GLchar *name); \ void bindFragmentInputLocation(GLuint programs, GLint location, const GLchar *name); \
void programPathFragmentInputGen(GLuint program, GLint location, GLenum genMode, \ void programPathFragmentInputGen(GLuint program, GLint location, GLenum genMode, \
GLint components, const GLfloat *coeffs); \ GLint components, const GLfloat *coeffs); \
......
...@@ -857,6 +857,13 @@ void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, gl::R ...@@ -857,6 +857,13 @@ void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, gl::R
os << "gRenderbufferMap[" << value.value << "]"; os << "gRenderbufferMap[" << value.value << "]";
} }
// TODO(jmadill): Use path ID map. http://anglebug.com/3611
template <>
void WriteParamValueToStream<ParamType::TPathID>(std::ostream &os, gl::PathID value)
{
os << value.value;
}
// TODO(jmadill): Use texture ID map. http://anglebug.com/3611 // TODO(jmadill): Use texture ID map. http://anglebug.com/3611
template <> template <>
void WriteParamValueToStream<ParamType::TTextureID>(std::ostream &os, gl::TextureID value) void WriteParamValueToStream<ParamType::TTextureID>(std::ostream &os, gl::TextureID value)
......
...@@ -267,6 +267,9 @@ void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, ...@@ -267,6 +267,9 @@ void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os,
gl::RenderbufferID value); gl::RenderbufferID value);
template <> template <>
void WriteParamValueToStream<ParamType::TPathID>(std::ostream &os, gl::PathID value);
template <>
void WriteParamValueToStream<ParamType::TTextureID>(std::ostream &os, gl::TextureID value); void WriteParamValueToStream<ParamType::TTextureID>(std::ostream &os, gl::TextureID value);
template <> template <>
......
...@@ -347,9 +347,9 @@ Sync *SyncManager::getSync(GLuint handle) const ...@@ -347,9 +347,9 @@ Sync *SyncManager::getSync(GLuint handle) const
PathManager::PathManager() = default; PathManager::PathManager() = default;
angle::Result PathManager::createPaths(Context *context, GLsizei range, GLuint *createdOut) angle::Result PathManager::createPaths(Context *context, GLsizei range, PathID *createdOut)
{ {
*createdOut = 0; *createdOut = {0};
// Allocate client side handles. // Allocate client side handles.
const GLuint client = mHandleAllocator.allocateRange(static_cast<GLuint>(range)); const GLuint client = mHandleAllocator.allocateRange(static_cast<GLuint>(range));
...@@ -372,34 +372,35 @@ angle::Result PathManager::createPaths(Context *context, GLsizei range, GLuint * ...@@ -372,34 +372,35 @@ angle::Result PathManager::createPaths(Context *context, GLsizei range, GLuint *
for (GLsizei i = 0; i < range; ++i) for (GLsizei i = 0; i < range; ++i)
{ {
rx::PathImpl *impl = paths[static_cast<unsigned>(i)]; rx::PathImpl *impl = paths[static_cast<unsigned>(i)];
const auto id = client + i; PathID id = PathID{client + i};
mPaths.assign(id, new Path(impl)); mPaths.assign(id, new Path(impl));
} }
*createdOut = client; *createdOut = PathID{client};
return angle::Result::Continue; return angle::Result::Continue;
} }
void PathManager::deletePaths(GLuint first, GLsizei range) void PathManager::deletePaths(PathID first, GLsizei range)
{ {
GLuint firstHandle = first.value;
for (GLsizei i = 0; i < range; ++i) for (GLsizei i = 0; i < range; ++i)
{ {
const auto id = first + i; GLuint id = firstHandle + i;
Path *p = nullptr; Path *p = nullptr;
if (!mPaths.erase(id, &p)) if (!mPaths.erase({id}, &p))
continue; continue;
delete p; delete p;
} }
mHandleAllocator.releaseRange(first, static_cast<GLuint>(range)); mHandleAllocator.releaseRange(firstHandle, static_cast<GLuint>(range));
} }
Path *PathManager::getPath(GLuint handle) const Path *PathManager::getPath(PathID handle) const
{ {
return mPaths.query(handle); return mPaths.query(handle);
} }
bool PathManager::hasPath(GLuint handle) const bool PathManager::hasPath(PathID handle) const
{ {
return mHandleAllocator.isUsed(handle); return mHandleAllocator.isUsed(GetIDValue(handle));
} }
PathManager::~PathManager() PathManager::~PathManager()
......
...@@ -257,17 +257,17 @@ class PathManager : public ResourceManagerBase<HandleRangeAllocator> ...@@ -257,17 +257,17 @@ class PathManager : public ResourceManagerBase<HandleRangeAllocator>
public: public:
PathManager(); PathManager();
angle::Result createPaths(Context *context, GLsizei range, GLuint *numCreated); angle::Result createPaths(Context *context, GLsizei range, PathID *numCreated);
void deletePaths(GLuint first, GLsizei range); void deletePaths(PathID first, GLsizei range);
Path *getPath(GLuint handle) const; Path *getPath(PathID handle) const;
bool hasPath(GLuint handle) const; bool hasPath(PathID handle) const;
protected: protected:
~PathManager() override; ~PathManager() override;
void reset(const Context *context) override; void reset(const Context *context) override;
private: private:
ResourceMap<Path> mPaths; ResourceMap<Path, PathID> mPaths;
}; };
class FramebufferManager class FramebufferManager
......
...@@ -1855,7 +1855,7 @@ void CaptureMatrixLoadfCHROMIUM_matrix(const Context *context, ...@@ -1855,7 +1855,7 @@ void CaptureMatrixLoadfCHROMIUM_matrix(const Context *context,
void CapturePathCommandsCHROMIUM_commands(const Context *context, void CapturePathCommandsCHROMIUM_commands(const Context *context,
bool isCallValid, bool isCallValid,
GLuint path, PathID path,
GLsizei numCommands, GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
...@@ -1868,7 +1868,7 @@ void CapturePathCommandsCHROMIUM_commands(const Context *context, ...@@ -1868,7 +1868,7 @@ void CapturePathCommandsCHROMIUM_commands(const Context *context,
void CapturePathCommandsCHROMIUM_coords(const Context *context, void CapturePathCommandsCHROMIUM_coords(const Context *context,
bool isCallValid, bool isCallValid,
GLuint path, PathID path,
GLsizei numCommands, GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
...@@ -1881,7 +1881,7 @@ void CapturePathCommandsCHROMIUM_coords(const Context *context, ...@@ -1881,7 +1881,7 @@ void CapturePathCommandsCHROMIUM_coords(const Context *context,
void CaptureGetPathParameterfvCHROMIUM_value(const Context *context, void CaptureGetPathParameterfvCHROMIUM_value(const Context *context,
bool isCallValid, bool isCallValid,
GLuint path, PathID path,
GLenum pname, GLenum pname,
GLfloat *value, GLfloat *value,
ParamCapture *paramCapture) ParamCapture *paramCapture)
...@@ -1891,7 +1891,7 @@ void CaptureGetPathParameterfvCHROMIUM_value(const Context *context, ...@@ -1891,7 +1891,7 @@ void CaptureGetPathParameterfvCHROMIUM_value(const Context *context,
void CaptureGetPathParameterivCHROMIUM_value(const Context *context, void CaptureGetPathParameterivCHROMIUM_value(const Context *context,
bool isCallValid, bool isCallValid,
GLuint path, PathID path,
GLenum pname, GLenum pname,
GLint *value, GLint *value,
ParamCapture *paramCapture) ParamCapture *paramCapture)
...@@ -1904,7 +1904,7 @@ void CaptureCoverFillPathInstancedCHROMIUM_paths(const Context *context, ...@@ -1904,7 +1904,7 @@ void CaptureCoverFillPathInstancedCHROMIUM_paths(const Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues, const GLfloat *transformValues,
...@@ -1918,7 +1918,7 @@ void CaptureCoverFillPathInstancedCHROMIUM_transformValues(const Context *contex ...@@ -1918,7 +1918,7 @@ void CaptureCoverFillPathInstancedCHROMIUM_transformValues(const Context *contex
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues, const GLfloat *transformValues,
...@@ -1932,7 +1932,7 @@ void CaptureCoverStrokePathInstancedCHROMIUM_paths(const Context *context, ...@@ -1932,7 +1932,7 @@ void CaptureCoverStrokePathInstancedCHROMIUM_paths(const Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues, const GLfloat *transformValues,
...@@ -1946,7 +1946,7 @@ void CaptureCoverStrokePathInstancedCHROMIUM_transformValues(const Context *cont ...@@ -1946,7 +1946,7 @@ void CaptureCoverStrokePathInstancedCHROMIUM_transformValues(const Context *cont
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues, const GLfloat *transformValues,
...@@ -1960,7 +1960,7 @@ void CaptureStencilStrokePathInstancedCHROMIUM_paths(const Context *context, ...@@ -1960,7 +1960,7 @@ void CaptureStencilStrokePathInstancedCHROMIUM_paths(const Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -1975,7 +1975,7 @@ void CaptureStencilStrokePathInstancedCHROMIUM_transformValues(const Context *co ...@@ -1975,7 +1975,7 @@ void CaptureStencilStrokePathInstancedCHROMIUM_transformValues(const Context *co
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -1990,7 +1990,7 @@ void CaptureStencilFillPathInstancedCHROMIUM_paths(const Context *context, ...@@ -1990,7 +1990,7 @@ void CaptureStencilFillPathInstancedCHROMIUM_paths(const Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -2005,7 +2005,7 @@ void CaptureStencilFillPathInstancedCHROMIUM_transformValues(const Context *cont ...@@ -2005,7 +2005,7 @@ void CaptureStencilFillPathInstancedCHROMIUM_transformValues(const Context *cont
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -2020,7 +2020,7 @@ void CaptureStencilThenCoverFillPathInstancedCHROMIUM_paths(const Context *conte ...@@ -2020,7 +2020,7 @@ void CaptureStencilThenCoverFillPathInstancedCHROMIUM_paths(const Context *conte
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
...@@ -2037,7 +2037,7 @@ void CaptureStencilThenCoverFillPathInstancedCHROMIUM_transformValues( ...@@ -2037,7 +2037,7 @@ void CaptureStencilThenCoverFillPathInstancedCHROMIUM_transformValues(
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
...@@ -2053,7 +2053,7 @@ void CaptureStencilThenCoverStrokePathInstancedCHROMIUM_paths(const Context *con ...@@ -2053,7 +2053,7 @@ void CaptureStencilThenCoverStrokePathInstancedCHROMIUM_paths(const Context *con
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
...@@ -2070,7 +2070,7 @@ void CaptureStencilThenCoverStrokePathInstancedCHROMIUM_transformValues( ...@@ -2070,7 +2070,7 @@ void CaptureStencilThenCoverStrokePathInstancedCHROMIUM_transformValues(
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBase,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
......
...@@ -259,6 +259,9 @@ void WriteParamTypeToStream(std::ostream &os, ParamType paramType, const ParamVa ...@@ -259,6 +259,9 @@ void WriteParamTypeToStream(std::ostream &os, ParamType paramType, const ParamVa
case ParamType::TMatrixType: case ParamType::TMatrixType:
WriteParamValueToStream<ParamType::TMatrixType>(os, paramValue.MatrixTypeVal); WriteParamValueToStream<ParamType::TMatrixType>(os, paramValue.MatrixTypeVal);
break; break;
case ParamType::TPathID:
WriteParamValueToStream<ParamType::TPathID>(os, paramValue.PathIDVal);
break;
case ParamType::TPointParameter: case ParamType::TPointParameter:
WriteParamValueToStream<ParamType::TPointParameter>(os, paramValue.PointParameterVal); WriteParamValueToStream<ParamType::TPointParameter>(os, paramValue.PointParameterVal);
break; break;
...@@ -506,6 +509,8 @@ const char *ParamTypeToString(ParamType paramType) ...@@ -506,6 +509,8 @@ const char *ParamTypeToString(ParamType paramType)
return "GLenum"; return "GLenum";
case ParamType::TMatrixType: case ParamType::TMatrixType:
return "GLenum"; return "GLenum";
case ParamType::TPathID:
return "GLuint";
case ParamType::TPointParameter: case ParamType::TPointParameter:
return "GLenum"; return "GLenum";
case ParamType::TPrimitiveMode: case ParamType::TPrimitiveMode:
......
...@@ -88,6 +88,7 @@ enum class ParamType ...@@ -88,6 +88,7 @@ enum class ParamType
TLogicalOperation, TLogicalOperation,
TMaterialParameter, TMaterialParameter,
TMatrixType, TMatrixType,
TPathID,
TPointParameter, TPointParameter,
TPrimitiveMode, TPrimitiveMode,
TProvokingVertexConvention, TProvokingVertexConvention,
...@@ -190,6 +191,7 @@ union ParamValue ...@@ -190,6 +191,7 @@ union ParamValue
gl::LogicalOperation LogicalOperationVal; gl::LogicalOperation LogicalOperationVal;
gl::MaterialParameter MaterialParameterVal; gl::MaterialParameter MaterialParameterVal;
gl::MatrixType MatrixTypeVal; gl::MatrixType MatrixTypeVal;
gl::PathID PathIDVal;
gl::PointParameter PointParameterVal; gl::PointParameter PointParameterVal;
gl::PrimitiveMode PrimitiveModeVal; gl::PrimitiveMode PrimitiveModeVal;
gl::ProvokingVertexConvention ProvokingVertexConventionVal; gl::ProvokingVertexConvention ProvokingVertexConventionVal;
...@@ -683,6 +685,12 @@ inline gl::MatrixType GetParamVal<ParamType::TMatrixType, gl::MatrixType>(const ...@@ -683,6 +685,12 @@ inline gl::MatrixType GetParamVal<ParamType::TMatrixType, gl::MatrixType>(const
} }
template <> template <>
inline gl::PathID GetParamVal<ParamType::TPathID, gl::PathID>(const ParamValue &value)
{
return value.PathIDVal;
}
template <>
inline gl::PointParameter GetParamVal<ParamType::TPointParameter, gl::PointParameter>( inline gl::PointParameter GetParamVal<ParamType::TPointParameter, gl::PointParameter>(
const ParamValue &value) const ParamValue &value)
{ {
...@@ -1017,6 +1025,8 @@ T AccessParamValue(ParamType paramType, const ParamValue &value) ...@@ -1017,6 +1025,8 @@ T AccessParamValue(ParamType paramType, const ParamValue &value)
return GetParamVal<ParamType::TMaterialParameter, T>(value); return GetParamVal<ParamType::TMaterialParameter, T>(value);
case ParamType::TMatrixType: case ParamType::TMatrixType:
return GetParamVal<ParamType::TMatrixType, T>(value); return GetParamVal<ParamType::TMatrixType, T>(value);
case ParamType::TPathID:
return GetParamVal<ParamType::TPathID, T>(value);
case ParamType::TPointParameter: case ParamType::TPointParameter:
return GetParamVal<ParamType::TPointParameter, T>(value); return GetParamVal<ParamType::TPointParameter, T>(value);
case ParamType::TPrimitiveMode: case ParamType::TPrimitiveMode:
...@@ -1525,6 +1535,12 @@ inline void SetParamVal<ParamType::TMatrixType>(gl::MatrixType valueIn, ParamVal ...@@ -1525,6 +1535,12 @@ inline void SetParamVal<ParamType::TMatrixType>(gl::MatrixType valueIn, ParamVal
} }
template <> template <>
inline void SetParamVal<ParamType::TPathID>(gl::PathID valueIn, ParamValue *valueOut)
{
valueOut->PathIDVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TPointParameter>(gl::PointParameter valueIn, inline void SetParamVal<ParamType::TPointParameter>(gl::PointParameter valueIn,
ParamValue *valueOut) ParamValue *valueOut)
{ {
...@@ -1923,6 +1939,9 @@ void InitParamValue(ParamType paramType, T valueIn, ParamValue *valueOut) ...@@ -1923,6 +1939,9 @@ void InitParamValue(ParamType paramType, T valueIn, ParamValue *valueOut)
case ParamType::TMatrixType: case ParamType::TMatrixType:
SetParamVal<ParamType::TMatrixType>(valueIn, valueOut); SetParamVal<ParamType::TMatrixType>(valueIn, valueOut);
break; break;
case ParamType::TPathID:
SetParamVal<ParamType::TPathID>(valueIn, valueOut);
break;
case ParamType::TPointParameter: case ParamType::TPointParameter:
SetParamVal<ParamType::TPointParameter>(valueIn, valueOut); SetParamVal<ParamType::TPointParameter>(valueIn, valueOut);
break; break;
......
...@@ -673,34 +673,46 @@ bool ValidateLoseContextCHROMIUM(Context *context, ...@@ -673,34 +673,46 @@ bool ValidateLoseContextCHROMIUM(Context *context,
// GL_CHROMIUM_path_rendering // GL_CHROMIUM_path_rendering
bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range); bool ValidateGenPathsCHROMIUM(Context *context, GLsizei range);
bool ValidateDeletePathsCHROMIUM(Context *context, GLuint first, GLsizei range); bool ValidateDeletePathsCHROMIUM(Context *context, PathID firstPacked, GLsizei range);
bool ValidateIsPathCHROMIUM(Context *context, GLuint path); bool ValidateIsPathCHROMIUM(Context *context, PathID pathPacked);
bool ValidatePathCommandsCHROMIUM(Context *context, bool ValidatePathCommandsCHROMIUM(Context *context,
GLuint path, PathID pathPacked,
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 ValidatePathParameterfCHROMIUM(Context *context, GLuint path, GLenum pname, GLfloat value); bool ValidatePathParameterfCHROMIUM(Context *context,
bool ValidatePathParameteriCHROMIUM(Context *context, GLuint path, GLenum pname, GLint value); PathID pathPacked,
GLenum pname,
GLfloat value);
bool ValidatePathParameteriCHROMIUM(Context *context, PathID pathPacked, GLenum pname, GLint value);
bool ValidateGetPathParameterfvCHROMIUM(Context *context, bool ValidateGetPathParameterfvCHROMIUM(Context *context,
GLuint path, PathID pathPacked,
GLenum pname, GLenum pname,
GLfloat *value); GLfloat *value);
bool ValidateGetPathParameterivCHROMIUM(Context *context, GLuint path, GLenum pname, GLint *value); bool ValidateGetPathParameterivCHROMIUM(Context *context,
PathID pathPacked,
GLenum pname,
GLint *value);
bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask); bool ValidatePathStencilFuncCHROMIUM(Context *context, GLenum func, GLint ref, GLuint mask);
bool ValidateStencilFillPathCHROMIUM(Context *context, GLuint path, GLenum fillMode, GLuint mask); bool ValidateStencilFillPathCHROMIUM(Context *context,
bool ValidateStencilStrokePathCHROMIUM(Context *context, GLuint path, GLint reference, GLuint mask); PathID pathPacked,
bool ValidateCoverFillPathCHROMIUM(Context *context, GLuint path, GLenum coverMode); GLenum fillMode,
bool ValidateCoverStrokePathCHROMIUM(Context *context, GLuint path, GLenum coverMode); GLuint mask);
bool ValidateStencilStrokePathCHROMIUM(Context *context,
PathID pathPacked,
GLint reference,
GLuint mask);
bool ValidateCoverFillPathCHROMIUM(Context *context, PathID pathPacked, GLenum coverMode);
bool ValidateCoverStrokePathCHROMIUM(Context *context, PathID pathPacked, GLenum coverMode);
bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context, bool ValidateStencilThenCoverFillPathCHROMIUM(Context *context,
GLuint path, PathID pathPacked,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode); GLenum coverMode);
bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context, bool ValidateStencilThenCoverStrokePathCHROMIUM(Context *context,
GLuint path, PathID pathPacked,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode); GLenum coverMode);
...@@ -708,7 +720,7 @@ bool ValidateCoverFillPathInstancedCHROMIUM(Context *context, ...@@ -708,7 +720,7 @@ bool ValidateCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
...@@ -716,7 +728,7 @@ bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context, ...@@ -716,7 +728,7 @@ bool ValidateCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLenum coverMode, GLenum coverMode,
GLenum transformType, GLenum transformType,
const GLfloat *transformValues); const GLfloat *transformValues);
...@@ -724,7 +736,7 @@ bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context, ...@@ -724,7 +736,7 @@ bool ValidateStencilStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPath, GLsizei numPath,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -733,7 +745,7 @@ bool ValidateStencilFillPathInstancedCHROMIUM(Context *context, ...@@ -733,7 +745,7 @@ bool ValidateStencilFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum transformType, GLenum transformType,
...@@ -742,7 +754,7 @@ bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context, ...@@ -742,7 +754,7 @@ bool ValidateStencilThenCoverFillPathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLenum fillMode, GLenum fillMode,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
...@@ -752,7 +764,7 @@ bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context, ...@@ -752,7 +764,7 @@ bool ValidateStencilThenCoverStrokePathInstancedCHROMIUM(Context *context,
GLsizei numPaths, GLsizei numPaths,
GLenum pathNameType, GLenum pathNameType,
const void *paths, const void *paths,
GLuint pathBase, PathID pathBasePacked,
GLint reference, GLint reference,
GLuint mask, GLuint mask,
GLenum coverMode, GLenum coverMode,
......
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