diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2015-10-28 01:50:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-28 08:50:58 +0000 |
commit | fb3f117d605fcba79a9a6e85dad021a6d77d57cc (patch) | |
tree | cd9bf8a44cffb4c2e9ce1e51ee5ac38bff29a3d6 /gpu/command_buffer/common/gles2_cmd_utils.cc | |
parent | 3dc5ef2ff48fa435753e97cb431fa5360aa3355a (diff) | |
download | chromium_src-fb3f117d605fcba79a9a6e85dad021a6d77d57cc.zip chromium_src-fb3f117d605fcba79a9a6e85dad021a6d77d57cc.tar.gz chromium_src-fb3f117d605fcba79a9a6e85dad021a6d77d57cc.tar.bz2 |
command_buffer: Support instanced path rendering in gpu command buffer
Implement support for instanced path rendering in gpu command buffer.
Exposes following new functions through command buffer:
glStencilFillPathInstancedCHROMIUM
glStencilStrokePathInstancedCHROMIUM
glCoverFillPathInstancedCHROMIUM
glCoverStrokePathInstancedCHROMIUM
glStencilThenCoverFillPathInstancedCHROMIUM
glStencilThenCoverStrokePathInstancedCHROMIUM
These functions are exposed as part of the CHROMIUM_path_rendering
GL ES extension.
Converts the NV_path_rendering functions that Skia calls to these
functions, passes the calls through the command buffer and then
calls the corresponding NV_path_rendering functions.
BUG=344330
Review URL: https://codereview.chromium.org/477623004
Cr-Commit-Position: refs/heads/master@{#356526}
Diffstat (limited to 'gpu/command_buffer/common/gles2_cmd_utils.cc')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 8417b06..0376425 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -739,6 +739,26 @@ size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32 type) { } } +size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) { + switch (type) { + case GL_TRANSLATE_X_CHROMIUM: + case GL_TRANSLATE_Y_CHROMIUM: + return 1; + case GL_TRANSLATE_2D_CHROMIUM: + return 2; + case GL_TRANSLATE_3D_CHROMIUM: + return 3; + case GL_AFFINE_2D_CHROMIUM: + case GL_TRANSPOSE_AFFINE_2D_CHROMIUM: + return 6; + case GL_AFFINE_3D_CHROMIUM: + case GL_TRANSPOSE_AFFINE_3D_CHROMIUM: + return 12; + default: + return 0; + } +} + size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) { switch (type) { case GL_BYTE: @@ -756,6 +776,25 @@ size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) { } } +size_t GLES2Util::GetGLTypeSizeForGLPathNameType(uint32 type) { + switch (type) { + case GL_BYTE: + return sizeof(GLbyte); // NOLINT + case GL_UNSIGNED_BYTE: + return sizeof(GLubyte); // NOLINT + case GL_SHORT: + return sizeof(GLshort); // NOLINT + case GL_UNSIGNED_SHORT: + return sizeof(GLushort); // NOLINT + case GL_INT: + return sizeof(GLint); // NOLINT + case GL_UNSIGNED_INT: + return sizeof(GLuint); // NOLINT + default: + return 0; + } +} + uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { switch (error) { case GL_INVALID_ENUM: |