diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2015-07-14 04:08:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-14 11:09:10 +0000 |
commit | b959a8467d84feb3431809fe4abafb9649c44b24 (patch) | |
tree | ef570319a26e2efb29bd1d6767a2f0ed1f3d73d0 /ui/gl/generate_bindings.py | |
parent | a39e79ebcde16f7604bf5de6bed0c665c8afe5b0 (diff) | |
download | chromium_src-b959a8467d84feb3431809fe4abafb9649c44b24.zip chromium_src-b959a8467d84feb3431809fe4abafb9649c44b24.tar.gz chromium_src-b959a8467d84feb3431809fe4abafb9649c44b24.tar.bz2 |
command_buffer: Implement path rendering functions for CHROMIUM_path_rendering
Add support for path rendering functions with CHROMIUM_path_rendering in
gpu command buffer. CHROMIUM_path_rendering pseudo extension will use
NV_path_rendering (NVPR).
After this patch, CHROMIUM_path_rendering is able to draw solid color
paths.
Adds following functions to the command buffer:
glGenPathsCHROMIUM
glDeletePathsCHROMIUM
glIsPathCHROMIUM
glPathCommandsCHROMIUM
glPathParameterfCHROMIUM
glPathParameteriCHROMIUM
glPathStencilFuncCHROMIUM
glStencilFillPathCHROMIUM
glStencilStrokePathCHROMIUM
glCoverFillPathCHROMIUM
glCoverStrokePathCHROMIUM
glStencilThenCoverFillPathCHROMIUM
glStencilThenCoverStrokePathCHROMIUM
Noteworthy items:
NVPR has calls with multiple data arrays. These will be passed by
memcpy:ing the arrays into the same transfer buffer. The arrays
containing GLfloats are copied first, because floats have more strict
alignment needs than whatever is in the other array.
The functions exposed by the command buffer take in subset of the values
that plain NVPR functions accept. Also some functions do not take
exact same amount of parameters, rather only those parameters that
are expected to vary based on Skia implementation.
The change does not add vertexshader-less shader program support to the
command buffer. The caller is expected to use a dummy vertex
shader. NVPR calls will ignore the vertex shader.
Adds gpu::gles2::PathManager class that should be similar to other
resource manager classes. The intention is that paths can be shared in
similar manner as other resources.
Changes generator to generate feature_info check for Is -type of
functions.
Moves the path matrix related constants from glchromium.h to
gl2extchromium.h, the constants are not "normal" GLES constants, rather
they are part of the extension.
Skia will not yet use the extension, because texturing support and
instanced variants of the draw functions are not exposed by
CHROMIUM_path_rendering.
The extension will be available through flag --enable-gl-path-rendering
BUG=344330
Review URL: https://codereview.chromium.org/169403005
Cr-Commit-Position: refs/heads/master@{#338666}
Diffstat (limited to 'ui/gl/generate_bindings.py')
-rwxr-xr-x | ui/gl/generate_bindings.py | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py index 2667b24..a3c4824 100755 --- a/ui/gl/generate_bindings.py +++ b/ui/gl/generate_bindings.py @@ -36,9 +36,13 @@ array instead of the names array. Each version has the following keys: extensions: Extra Extensions for which the function is bound. Only needed in some cases where the extension cannot be parsed from the headers. - + is_optional: True if the GetProcAddress can return NULL for the + function. This may happen for example when functions + are added to a new version of an extension, but the + extension string is not modified. By default, the function gets its name from the first name in its names or versions array. This can be overridden by supplying a 'known_as' key. + """ GL_FUNCTIONS = [ { 'return_type': 'void', @@ -235,6 +239,12 @@ GL_FUNCTIONS = [ 'arguments': 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 'GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height', }, +{ 'return_type': 'void', + 'names': ['glCoverFillPathNV'], + 'arguments': 'GLuint path, GLenum coverMode' }, +{ 'return_type': 'void', + 'names': ['glCoverStrokePathNV'], + 'arguments': 'GLuint name, GLenum coverMode' }, { 'return_type': 'GLuint', 'names': ['glCreateProgram'], 'arguments': 'void', }, @@ -260,6 +270,9 @@ GL_FUNCTIONS = [ 'names': ['glDeleteFramebuffersEXT', 'glDeleteFramebuffers'], 'arguments': 'GLsizei n, const GLuint* framebuffers', }, { 'return_type': 'void', + 'names': ['glDeletePathsNV'], + 'arguments': 'GLuint path, GLsizei range' }, +{ 'return_type': 'void', 'names': ['glDeleteProgram'], 'arguments': 'GLuint program', }, { 'return_type': 'void', @@ -438,6 +451,9 @@ GL_FUNCTIONS = [ { 'return_type': 'void', 'names': ['glGenFramebuffersEXT', 'glGenFramebuffers'], 'arguments': 'GLsizei n, GLuint* framebuffers', }, +{ 'return_type': 'GLuint', + 'names': ['glGenPathsNV'], + 'arguments': 'GLsizei range' }, { 'return_type': 'void', 'versions': [{ 'name': 'glGenQueries' }, { 'name': 'glGenQueriesARB', }, @@ -705,6 +721,9 @@ GL_FUNCTIONS = [ 'names': ['glIsFramebufferEXT', 'glIsFramebuffer'], 'arguments': 'GLuint framebuffer', }, { 'return_type': 'GLboolean', + 'names': ['glIsPathNV'], + 'arguments': 'GLuint path' }, +{ 'return_type': 'GLboolean', 'names': ['glIsProgram'], 'arguments': 'GLuint program', }, { 'return_type': 'GLboolean', @@ -771,6 +790,19 @@ GL_FUNCTIONS = [ 'GL_NV_path_rendering'] },], 'arguments': 'GLenum matrixMode' }, { 'return_type': 'void', + 'names': ['glPathCommandsNV'], + 'arguments': 'GLuint path, GLsizei numCommands, const GLubyte* commands, ' + 'GLsizei numCoords, GLenum coordType, const GLvoid* coords' }, +{ 'return_type': 'void', + 'names': ['glPathParameterfNV'], + 'arguments': 'GLuint path, GLenum pname, GLfloat value' }, +{ 'return_type': 'void', + 'names': ['glPathParameteriNV'], + 'arguments': 'GLuint path, GLenum pname, GLint value' }, +{ 'return_type': 'void', + 'names': ['glPathStencilFuncNV'], + 'arguments': 'GLenum func, GLint ref, GLuint mask' }, +{ 'return_type': 'void', 'versions': [{ 'name': 'glPauseTransformFeedback' }], 'arguments': 'void', }, { 'return_type': 'void', @@ -889,6 +921,9 @@ GL_FUNCTIONS = [ }); """, }, { 'return_type': 'void', + 'names': ['glStencilFillPathNV'], + 'arguments': 'GLuint path, GLenum fillMode, GLuint mask' }, +{ 'return_type': 'void', 'names': ['glStencilFunc'], 'arguments': 'GLenum func, GLint ref, GLuint mask', }, { 'return_type': 'void', @@ -906,6 +941,17 @@ GL_FUNCTIONS = [ { 'return_type': 'void', 'names': ['glStencilOpSeparate'], 'arguments': 'GLenum face, GLenum fail, GLenum zfail, GLenum zpass', }, +{ 'return_type': 'void', + 'names': ['glStencilStrokePathNV'], + 'arguments': 'GLuint path, GLint reference, GLuint mask' }, +{ 'return_type': 'void', + 'names': ['glStencilThenCoverFillPathNV'], + 'arguments': 'GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode', + 'is_optional': True, }, +{ 'return_type': 'void', + 'names': ['glStencilThenCoverStrokePathNV'], + 'arguments': 'GLuint path, GLint reference, GLuint mask, GLenum coverMode', + 'is_optional': True, }, { 'return_type': 'GLboolean', 'known_as': 'glTestFenceAPPLE', 'versions': [{ 'name': 'glTestFenceAPPLE', @@ -1905,7 +1951,8 @@ namespace gfx { file.write(' else if (%s) {\n ' % (cond)) WriteFuncBinding(file, known_as, version['name']) - file.write('DCHECK(fn.%sFn);\n' % known_as) + if not 'is_optional' in func or not func['is_optional']: + file.write('DCHECK(fn.%sFn);\n' % known_as) file.write('}\n') i += 1 first_version = False |