The attached patch achieves the same result (processing events in a
valid order) by including the approximation of the intersection
coordinates in the event->point member.
It is thus easy to adjust the event comparison function to avoid
that intersection events having y coordinate approximated in default
are processed before start events having that same exact y.
To simplify the rounding computation it exploits the fact that in
intersect_lines den_det is always positive, because intersect_lines
is only called after _slope_compare returned > 0 and _slope_compare
is returning the sign of den_det.
And it also simplifies _cairo_bo_edge_contains_intersect_point because
comparing at top is useless as it is explained in the comment and the
quadratic-time finder mentioned there is only present (but unusable) in
src/cairo-bentley-ottman.c, whereas the comparison at bottom is necessary
when edge.p2.y != edge.bottom, but comparing only the y is sufficient.
On my laptop running:
DISPLAY=:2 make -s test TARGETS=image,xlib,xcb
reports the same number of failures with/without the patch and also
replicating the changes in the patch to
src/cairo-{bentley-ottman,polygon-reduce}.c
Well the big number of failures in the test suite could hide newly
introduced bugs, so considering the target image.argb32
tests executing intersection_sweep (in src/cairo-polygon-intersect.c) are
Created attachment 106407
proposed patch
The attached patch achieves the same result (processing events in a
valid order) by including the approximation of the intersection
coordinates in the event->point member.
It is thus easy to adjust the event comparison function to avoid
that intersection events having y coordinate approximated in default
are processed before start events having that same exact y.
To simplify the rounding computation it exploits the fact that in
intersect_lines den_det is always positive, because intersect_lines
is only called after _slope_compare returned > 0 and _slope_compare
is returning the sign of den_det.
And it also simplifies _cairo_ bo_edge_ contains_ intersect_ point because bentley- ottman. c, whereas the comparison at bottom is necessary
comparing at top is useless as it is explained in the comment and the
quadratic-time finder mentioned there is only present (but unusable) in
src/cairo-
when edge.p2.y != edge.bottom, but comparing only the y is sufficient.
On my laptop running:
DISPLAY=:2 make -s test TARGETS= image,xlib, xcb
reports the same number of failures with/without the patch and also {bentley- ottman, polygon- reduce} .c
replicating the changes in the patch to
src/cairo-
Well the big number of failures in the test suite could hide newly
introduced bugs, so considering the target image.argb32
tests executing intersection_sweep (in src/cairo- polygon- intersect. c) are
bug-bo-ricotz clip-disjoint clip-disjoint- hatching clip-disjoint-quad unbounded clip-fill- nz-unbounded clip-fill- eo-unbounded shapes- circles clip-operator clip-polygons paint-alpha- clip-mask
clip-stroke-
clip-fill clip-group-
clip-stroke clip-twice hatchings random-clip record90-
rotated-clip tighten-bounds trap-clip
of which only trap-clip and clip-operator are failing here, so anyway the
test-suite is exercising and verifying the code modified.