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:
parent
83ddf3d850
commit
08f1ea3e45
Notes:
sideshowbarker
2024-07-19 02:55:55 +09:00
Author: https://github.com/awesomekling
Commit: 08f1ea3e45
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue