1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibGfx: Make fill_rect_with_dither_pattern() skip transparent colors

Maybe this should do full blending, but for now at least skip source
pixels that have zero alpha.
This commit is contained in:
Andreas Kling 2020-09-01 19:10:09 +02:00
parent 83ddf3d850
commit 08f1ea3e45
Notes: sideshowbarker 2024-07-19 02:55:55 +09:00

View file

@ -154,6 +154,10 @@ void Painter::fill_rect_with_dither_pattern(const IntRect& a_rect, Color color_a
for (int i = 0; i < rect.height(); ++i) {
for (int j = 0; j < rect.width(); ++j) {
bool checkboard_use_a = (i & 1) ^ (j & 1);
if (checkboard_use_a && !color_a.alpha())
continue;
if (!checkboard_use_a && !color_b.alpha())
continue;
dst[j] = checkboard_use_a ? color_a.value() : color_b.value();
}
dst += dst_skip;