Stefan Brüns : d2d1: Use the TYPE_END vertex type when last/first vertices coincide.

Alexandre Julliard julliard at winehq.org
Tue Jan 11 15:45:38 CST 2022


Module: wine
Branch: master
Commit: b92b6c29298805abd18a3c7ea0f7905099af572d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b92b6c29298805abd18a3c7ea0f7905099af572d

Author: Stefan Brüns <stefan.bruens at rwth-aachen.de>
Date:   Tue Jan 11 16:28:16 2022 +0100

d2d1: Use the TYPE_END vertex type when last/first vertices coincide.

When the last vertex is coincident with the first vertex, the last
segment should be suppressed for both END_OPEN and END_CLOSED.
Only when last and first vertex are not coincident the additional
line segment may be added - always for intersection tests and
similar, and for stroking operations when the figure is CLOSED.

Trying to use an zero-length segment in d2d_geometry_intersect_self()
will create invalid segments, causing infinite loops later.

Instead of reducing the vertex_count for coincident first/last
vertices add a dedicated type. This is required as some operations
need the last segment, others do not.

This also allows to remove some replicated code in
StrokeContains()/GetBounds()/Simplify(), as a last Bézier segment
is always processed in the regular loop.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
Signed-off-by: Stefan Brüns <stefan.bruens at rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d2d1/geometry.c   | 105 +++++++++++++++----------------------------------
 dlls/d2d1/tests/d2d1.c |  16 +++++++-
 2 files changed, 46 insertions(+), 75 deletions(-)

Diff:   https://source.winehq.org/git/wine.git/?a=commitdiff;h=b92b6c29298805abd18a3c7ea0f7905099af572d



More information about the wine-cvs mailing list