Skip to content
  • kkinnunen's avatar
    command_buffer: Implement path rendering functions for CHROMIUM_path_rendering · b959a846
    kkinnunen authored
    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}
    b959a846