• Correctness and optimizations for clips in different coord systems.

    For clips that are in a different coordinate system, it's not
    generally feasible to get a correct mapping into a different
    coordinate system - so handle these clips in world space. For
    now, the world space is actually screen space. However, it is
    trivial to modify this so that the world space is the coordinate
    system that we are rasterizing this picture in.
    
    As an optimization, if we encounter a primitive that is large,
    and has clips from a different coord system, but no local clips,
    then segment it into a uniform grid. This allows large primitives
    that would not otherwise be segmented to opt in to segmenting,
    which can significantly reduce the size of the allocated clip
    masks for that primitive.
    
    As a further optimization, we are now able to generate a custom
    clip chain instance for each segment, rather than using the
    clip chain from the primitive. This allows us to build a more
    optimized clip chain, based on the segment rectangle, which can
    often remove redundant clips from the mask for each segment, or
    even determine that this segment is not affected by any clips
    at all.
    gw3583 committed Aug 23, 2018