Browse Source

LibGfx: Simplify condition

This is just an XOR. No behaviour change.
MacDue 1 year ago
parent
commit
b4eb66d9fe
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp

+ 2 - 4
Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp

@@ -322,11 +322,9 @@ 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
-                    if ((previous_winding_count == 0 && sum_winding.counts[y_sub] != 0)
-                        || (sum_winding.counts[y_sub] == 0 && previous_winding_count != 0)) {
+                    // Toggle fill on change to/from zero.
+                    if (bool(previous_winding_count) ^ bool(sum_winding.counts[y_sub]))
                         sample ^= subpixel_bit;
                         sample ^= subpixel_bit;
-                    }
                 }
                 }
             }
             }
         }
         }