Name

    CHROMIUM_schedule_ca_layer

Name Strings

    GL_CHROMIUM_schedule_ca_layer

Version

    Last Modified Date: April 12, 2016

Dependencies

    OpenGL ES 2.0 is required.

Overview

    This extension allows a client to request a texture be presented as a
    CoreAnimation layer. The expectation is that all the CALayers scheduled
    since the last call to glSwapBuffers or glPostSubBufferCHROMIUM are
    displayed atomically at the time of the next call to swap buffers. Scheduled
    CALayers are not stateful and need to be rescheduled after the buffers were
    swapped.

Issues

    None

New Tokens

    Accepted by the <edge_aa_mask> parameter of glScheduleCALayerCHROMIUM:
    GL_CA_LAYER_EDGE_LEFT_CHROMIUM                    0x01
    GL_CA_LAYER_EDGE_RIGHT_CHROMIUM                   0x02
    GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM                  0x04
    GL_CA_LAYER_EDGE_TOP_CHROMIUM                     0x08

New Procedures and Functions

    The command

        glScheduleCALayerSharedStateCHROMIUM(GLfloat opacity,
                                             GLboolean is_clipped,
                                             const GLfloat* clip_rect,
                                             GLint sorting_context_id,
                                             const GLfloat* transform);

    sets state that will be shared by each subsequent call to
    glScheduleCALayerCHROMIUM. A subsequent call to
    glScheduleCALayerSharedStateCHROMIUM overrides the previous shared state
    values. A call to glSwapBuffers clears the shared state values.
    <opacity> specifies the opacity of the CALayer.
    <is_clipped> indicates if the layer should be clipped.
    <clip_rect> contains four values indicating the x, y, width, and height of
    the rectangle to clip the layer to, if it is to be clipped.
    <sorting_context_id> Layers in a non-zero sorting context exist in the same
    3D space and should intersect.
    <transform> contains sixteen values indicating the row major order 4x4
    transformation matrix to apply to the CALayer.

    The command

        glScheduleCALayerCHROMIUM(GLuint contents_texture_id,
                                  const GLfloat* contents_rect,
                                  GLuint background_color,
                                  GLuint edge_aa_mask,
                                  const GLfloat* bounds_rect,
                                  GLuint filter);

    requires that shared state has been previously set by
    glScheduleCALayerSharedStateCHROMIUM. It sets the CALayer parameters to be
    presented at the time of the next call to swap buffers. The order of the
    calls schedule CALayers determines their back-to-front presentation order.
    <contents_texture_id> is the texture to be presented. If zero, then the
    CALayer will be a solid color.
    <contents_rect> contains four values indicating the x, y, width, and height
    of the sub-rectangle to display from the texture specified in
    <contents_texture_id>, in normalized coordinates.
    <background_color> specifies the background color of the CALayer, as a
    32-bit ARGB value.
    <edge_aa_mask> is a bitfield specifying which of the edges of the layer are
    to have anti-aliasing.
    <bounds_rect> contains four values indicating the x, y, width, and height of
    the layer in pixels.
    <filter> will be used for both minification and magnification filtering. The
    only valid values are GL_LINEAR and GL_NEAREST.

    The command

       glScheduleCALayerInUseQueryCHROMIUM(GLsizei count, GLuint* textures);

    schedules a query at the time of the next call to swap buffers. If the given
    texture is backed by an IOSurface, then the query checks to see whether the
    IOSurface is in use by the Window Server. Otherwise, the query returns
    false. All the results will be returned with the swap ACK in
    SwapBuffersCompleteParams. Clients should not destroy any textures while
    they are being queried, as the swap ACK will use the original texture id to
    identify the queried textures.

Errors

    GL_INVALID_OPERATION is generated when glScheduleCALayerCHROMIUM is called
    without a prior call to glScheduleCALayerSharedStateCHROMIUM.

New State

    None.

Revision History

    6/13/2016    Add glScheduleCALayerInUseQueryCHROMIUM.
    4/12/2016    Add a parameter to support minification and magnification
                 filtering.
    12/16/2015   Add clipping and edge anti-aliasing.
    11/7/2015    Initial checkin

