summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
diff options
context:
space:
mode:
authorkkinnunen <kkinnunen@nvidia.com>2015-07-14 04:08:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 11:09:10 +0000
commitb959a8467d84feb3431809fe4abafb9649c44b24 (patch)
treeef570319a26e2efb29bd1d6767a2f0ed1f3d73d0 /gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
parenta39e79ebcde16f7604bf5de6bed0c665c8afe5b0 (diff)
downloadchromium_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 'gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
index 1c4cf97..5e23712 100644
--- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
@@ -474,6 +474,45 @@ static const GLenum valid_matrix_mode_table[] = {
GL_PATH_MODELVIEW_CHROMIUM,
};
+static const GLenum valid_path_coord_type_table[] = {
+ GL_BYTE,
+ GL_UNSIGNED_BYTE,
+ GL_SHORT,
+ GL_UNSIGNED_SHORT,
+ GL_FLOAT,
+};
+
+static const GLenum valid_path_cover_mode_table[] = {
+ GL_CONVEX_HULL_CHROMIUM,
+ GL_BOUNDING_BOX_CHROMIUM,
+};
+
+static const GLenum valid_path_fill_mode_table[] = {
+ GL_INVERT,
+ GL_COUNT_UP_CHROMIUM,
+ GL_COUNT_DOWN_CHROMIUM,
+};
+
+static const GLenum valid_path_parameter_table[] = {
+ GL_PATH_STROKE_WIDTH_CHROMIUM,
+ GL_PATH_END_CAPS_CHROMIUM,
+ GL_PATH_JOIN_STYLE_CHROMIUM,
+ GL_PATH_MITER_LIMIT_CHROMIUM,
+ GL_PATH_STROKE_BOUND_CHROMIUM,
+};
+
+static const GLint valid_path_parameter_cap_values_table[] = {
+ GL_FLAT,
+ GL_SQUARE_CHROMIUM,
+ GL_ROUND_CHROMIUM,
+};
+
+static const GLint valid_path_parameter_join_values_table[] = {
+ GL_MITER_REVERT_CHROMIUM,
+ GL_BEVEL_CHROMIUM,
+ GL_ROUND_CHROMIUM,
+};
+
static const GLenum valid_pixel_store_table[] = {
GL_PACK_ALIGNMENT,
GL_UNPACK_ALIGNMENT,
@@ -1148,6 +1187,20 @@ Validators::Validators()
map_buffer_access(valid_map_buffer_access_table,
arraysize(valid_map_buffer_access_table)),
matrix_mode(valid_matrix_mode_table, arraysize(valid_matrix_mode_table)),
+ path_coord_type(valid_path_coord_type_table,
+ arraysize(valid_path_coord_type_table)),
+ path_cover_mode(valid_path_cover_mode_table,
+ arraysize(valid_path_cover_mode_table)),
+ path_fill_mode(valid_path_fill_mode_table,
+ arraysize(valid_path_fill_mode_table)),
+ path_parameter(valid_path_parameter_table,
+ arraysize(valid_path_parameter_table)),
+ path_parameter_cap_values(
+ valid_path_parameter_cap_values_table,
+ arraysize(valid_path_parameter_cap_values_table)),
+ path_parameter_join_values(
+ valid_path_parameter_join_values_table,
+ arraysize(valid_path_parameter_join_values_table)),
pixel_store(valid_pixel_store_table, arraysize(valid_pixel_store_table)),
pixel_store_alignment(valid_pixel_store_alignment_table,
arraysize(valid_pixel_store_alignment_table)),