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

Switch box-shadows to be a clip source instead of a picture. #2487

Merged
merged 2 commits into from Mar 7, 2018

Commits on Mar 6, 2018

  1. Switch box-shadows to be a clip source instead of a picture.

    In hindsight, drawing box-shadows as a picture was not a good
    abstraction. Instead, we now treat them as a simple clip source
    that writes to the primitive clip mask, and is applied to the
    box-shadow primitive which is just a solid rectangle.
    
    This has a number of benefits:
     * The code for inset box-shadows is significantly simpler.
     * We remove two shaders (brush_picture and brush_mask) completely.
     * We get better batching, since box-shadows are just a solid rect + clip mask.
     * When we start to cache clip masks, box-shadows will gain this automatically.
     * Both outset and inset box-shadows now correctly use segments, which makes inset shadows significantly faster than previously.
     * Since the code is abstracted from Picture, fixing up how we handle sub-pixel blur radii etc is easier.
      * This is not done in this PR, but is much simpler to do than it would have been previously.
    
    Overview of specific changes:
     * Remove PictureKind::BoxShadow.
     * Add ClipMaskSource::BoxShadow.
     * Use segment rendering to minimize clip mask allocated size and pixels for all box-shadows.
     * Remove brush_picture and brush_mask_rounded_rect shader.
     * Remove scale_factor from blur task - no longer needed.
      * This makes possible some future work to fix up existing drop-shadow bugs.
     * Add cs_clip_box_shadow shader. Can probably be unified with cs_clip_image quite easily.
     * (Initial) support for local-space clip mask generation. Needed for future tasks related to rasterizing animated stacking contexts.
    gw3583 committed Mar 6, 2018

Commits on Mar 7, 2018

  1. Handle minimal shadow rects with fractional offsets / sizes.

    gw3583 committed Mar 7, 2018
You can’t perform that action at this time.