Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arbitrary rasterization coordinate roots. #3030

Merged
merged 5 commits into from Sep 11, 2018
Merged

Commits on Sep 9, 2018

  1. Support arbitrary rasterization coordinate roots.

    This allows us to choose to rasterize any picture in an
    arbitrary coordinate space.
    
    This fixes a large number of real world pages that use 3d
    transforms. It also simplifies fixing any remaining 3d
    transform related issues.
    
    The initial patch uses this to promote any picture that has
    perspective into a rasterization root.
    
    There are a number of benefits to this:
     * It simplifies a lot of the math involving plane splitting,
       since we don't need to deal with splits drawn in screen-space.
     * It makes caching perspective rendered pictures much easier,
       since we can cache them between frames even when the
       root coordinate system is animating the picture (this isn't
       implemented yet, but is a simple-ish follow up).
    
    We can make use of this to render text shadows in local space,
    as a performance optimization (which can then be cached between
    frames and display lists).
    
    Part of this change involves simplifying the plane splitting
    code to work in a similar way to traditional brush images. It's
    likely that in the future we can completely remove ps_split_composite
    and draw plane splits with brush_image for better batching.
    
    Introducing a new coordinate space allows for some more optimal
    calculations of required raster rectangles, which reduces the
    number of pixels that we draw for clip masks and transformed
    pictures, in some cases.
    
    Follow ups:
     * Support arbitrary rasterization scales for raster roots, for
       better quality / performance.
     * Support caching of pictures as discussed above.
    gw3583 committed Sep 9, 2018
  2. Fix a bug

    gw3583 committed Sep 9, 2018
  3. Address some review comments

    gw3583 committed Sep 9, 2018
  4. Address more review comments

    gw3583 committed Sep 9, 2018

Commits on Sep 11, 2018

  1. Add normal clip mask support to ps_split_composite.

    The split composite shader is now quite similar to a normal
    brush shader (uses prim header, supports normal clip masks
    etc). The only real difference is that it draws a quad polygon
    from local points instead of a rectangle. It should be easy
    to unify this into the brush_image shader in the future.
    
    Add a temporary "ClipNodeCollector" interface to correctly
    handle clips that are ancestors of the current rasterization
    root. Although it's not enforced by the API, I have verified
    that any time a clip from a spatial node that is an ancestor
    of the current rasterization root is applied on all primitives
    that are part of that picture. This means we can safely apply
    those clips during compositing of the rasterization root rather
    than on each individual primitive. This fixes correctness
    issues with clips across rasterization roots, and is also a
    quite significant performance win in some cases, since the
    clip mask is now applied once when the rasterization root
    is drawn, rather than on each indidvidual primitive.
    
    The end result of this is actually quite good - it will allow
    us to simplify some of the clipping code in the future, and is
    a performance win. The implementation leaves a lot to be
    desired, but gets the required result without having to fix
    up both gecko and wr clipping API mismatches. The long term
    solution for this is to update gecko and WR to make better use
    of clip chains on stacking contexts, rather than putting
    clips from the stacking context on each individual primitive (we
    have discussed doing this previously, but it's low-ish priority
    for now given other bugs).
    gw3583 committed Sep 11, 2018
You can’t perform that action at this time.