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

Optimization: draw solid, single color borders as rect + clip. #2626

Merged
merged 1 commit into from Apr 6, 2018

Commits on Apr 6, 2018

  1. Optimization: draw solid, single color borders as rect + clip.

    Due to various recent optimizations and features added for the
    segment logic, it's now feasible to start drawing borders as
    a solid rect + clip mask.
    
    For now, we start with only the simplest and most common case,
    borders with style: solid and a single color.
    
    This optimization applies in a couple of ways:
     * Fewer shader switches and better batching. Specifically, we
       can often batch these simple borders into an existing solid
       rect batch. Additionally, the edge segments of borders are
       typically considered opaque segments, which are more efficient
       to batch, and help with early z-reject of other fragments.
    
     * Once we start to cache clip masks between elements, and also
       across frames / display lists, we'll automatically get some
       wins here by only rendering a border corner mask once where
       applicable. Many real world sites use a common border radius
       on all buttons, for example, so this can be a significant
       optimization in these cases.
    gw3583 committed Apr 6, 2018
You can’t perform that action at this time.