Skip to content

Allow shapes to also have a mask #126

@corranwebster

Description

@corranwebster

Currently we can restrict drawing using a clip region, which subsamples the raster when drawing so that it only contains the area inside the clip. This allows efficient drawing.

A mask would require two-phase compositing: draw the shape into a temporary frame buffer/raster, draw the mask into a mask framebuffer/raster, then blit the mask into the temporary frame buffer/raster with appropriate key color and using a specific rgb565 value, and then blit the temporary buffer into the aggregating raster with the specific value as the key color to ensure only the area inside the mask is transferred.

This significantly increases potential memory usage: worst case is that you need a temporary buffer and mask buffer the same size as your raster. You also need to ensure that the temporary and mask buffers are cleared between operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions