summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-06-03 23:47:31 +0100
committerAndreas Kling <kling@serenityos.org>2023-06-04 05:40:39 +0200
commite853139cf0d2903c9173e6327908c6a57e27e409 (patch)
tree7b941ec9acca13a1c5627eb8c37778d4bd406637
parent6abc51d9f80892feef201bda6194bf5beaa7092f (diff)
downloadserenity-e853139cf0d2903c9173e6327908c6a57e27e409.zip
LibGfx: Fix adding active edges in filled path rasterizer
This was previously masked by sorting the edges on max_y, but if the last added edge pointed to an edge that ended on the current scanline, that edge (and what it points to) would also end up added to the active edges. These edges would then never get removed, and break things very badly!
-rw-r--r--Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp b/Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp
index cb0fd5f2ce..550ca63263 100644
--- a/Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp
+++ b/Userland/Libraries/LibGfx/EdgeFlagPathRasterizer.cpp
@@ -230,6 +230,9 @@ Detail::Edge* EdgeFlagPathRasterizer<SamplesPerPixel>::plot_edges_for_scanline(i
current_edge = current_edge->next_edge;
}
+ if (prev_edge)
+ prev_edge->next_edge = nullptr;
+
m_edge_table[scanline] = nullptr;
return active_edges;
}