1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 13:47:35 +00:00

LibGfx: Simplify condition

This is just an XOR. No behaviour change.
This commit is contained in:
MacDue 2024-01-02 20:45:06 +00:00 committed by Andreas Kling
parent db51e80d50
commit b4eb66d9fe

View file

@ -322,14 +322,12 @@ void EdgeFlagPathRasterizer<SamplesPerPixel>::accumulate_non_zero_scanline(EdgeE
auto winding = m_windings[x].counts[y_sub]; auto winding = m_windings[x].counts[y_sub];
auto previous_winding_count = sum_winding.counts[y_sub]; auto previous_winding_count = sum_winding.counts[y_sub];
sum_winding.counts[y_sub] += winding; sum_winding.counts[y_sub] += winding;
// Toggle fill on change to/from zero // Toggle fill on change to/from zero.
if ((previous_winding_count == 0 && sum_winding.counts[y_sub] != 0) if (bool(previous_winding_count) ^ bool(sum_winding.counts[y_sub]))
|| (sum_winding.counts[y_sub] == 0 && previous_winding_count != 0)) {
sample ^= subpixel_bit; sample ^= subpixel_bit;
} }
} }
} }
}
sample_callback(x, sample); sample_callback(x, sample);
m_scanline[x] = 0; m_scanline[x] = 0;
m_windings[x] = {}; m_windings[x] = {};