diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-02-09 17:18:41 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-09 19:36:26 +0100 |
commit | a796207b9fb139c85d6350062689d97dd5e98902 (patch) | |
tree | 4a7b6d177574af2fdd53bd15c465963251366065 /AK | |
parent | 3ec71e140058ff8115d712656155d835e9dae840 (diff) | |
download | serenity-a796207b9fb139c85d6350062689d97dd5e98902.zip |
LibWeb: Paint box-shadows more efficiently
Our previous code roughly did this:
1. Generate a bitmap as large as the shadow would end up.
2. Paint a rectangle onto it.
3. Blur the whole bitmap.
4. Split it up and render each section.
This patch takes advantage of the fact that (aside from corners) each
horizontal or vertical strip of a box-shadow is identical to the
others, to generate and blur a much smaller bitmap - only large enough
for the four corners and 1px of central "side" in each direction. This
greatly reduces the memory footprint, and should also speed things up,
since there is much less to blur.
Diffstat (limited to 'AK')
0 files changed, 0 insertions, 0 deletions