diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2023-05-31 22:01:43 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-06-01 06:18:57 +0200 |
commit | 5339b54b5dbe9a26d4e20fb75f5ed20a7fcef495 (patch) | |
tree | ffa87d25ccb99a2427b56b45712e394e3fc19be8 /AK/GenericShorthands.h | |
parent | 8a40b49b8b3040d02a9530699d8254edf109d7e1 (diff) | |
download | serenity-5339b54b5dbe9a26d4e20fb75f5ed20a7fcef495.zip |
LibGfx: Improve glyph rendering speed for vector fonts
The glyph bitmap is a grayscale image that is multiplied with the
requested color provided to `Gfx::Painter::draw_glyph()` to get the
final glyph bitmap that can be blitted.
Using `Gfx::Color::multiply()` is unnecessary however: by simply taking
the destination color and copying over the glyph bitmap's alpha value,
we can prevent four multiplications and divisions per pixel.
In an artifical benchmark I wrote, this improved glyph rendering
performance by ~9%.
Diffstat (limited to 'AK/GenericShorthands.h')
0 files changed, 0 insertions, 0 deletions