mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
LibGfx: Eliminate conditional branch in dither
In theory, this should make dithering a teensy bit faster.
This commit is contained in:
parent
c88c883f44
commit
ebe47de0b2
1 changed files with 2 additions and 4 deletions
|
@ -147,10 +147,8 @@ void Painter::fill_rect_with_dither_pattern(const Rect& a_rect, Color color_a, C
|
|||
|
||||
for (int i = 0; i < rect.height(); ++i) {
|
||||
for (int j = 0; j < rect.width(); ++j) {
|
||||
if (i & 1)
|
||||
dst[j] = (j & 1) ? color_a.value() : color_b.value();
|
||||
else
|
||||
dst[j] = (j & 1) ? color_b.value() : color_a.value();
|
||||
bool checkboard_use_a = (i & 1) ^ (j & 1);
|
||||
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