Implement boolean operations on paths

Implement union, intersection, difference and
symmetric difference of two paths, as well as
simplification of a single path.
This commit is contained in:
Matthias Clasen
2022-03-20 22:01:05 -04:00
parent 6a1660b78e
commit 42eaacbab4
3 changed files with 1727 additions and 0 deletions

1712
gsk/gskpathops.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -56,5 +56,19 @@ gboolean gsk_path_foreach_with_tolerance (GskPath
void gsk_path_builder_add_contour (GskPathBuilder *builder,
GskContour *contour);
typedef enum
{
GSK_PATH_OP_SIMPLIFY,
GSK_PATH_OP_UNION,
GSK_PATH_OP_INTERSECTION,
GSK_PATH_OP_DIFFERENCE,
GSK_PATH_OP_XOR
} GskPathOp;
GskPath * gsk_path_op (GskPathOp operation,
GskFillRule fill_rule,
GskPath *first,
GskPath *second);
G_END_DECLS

View File

@@ -30,6 +30,7 @@ gsk_public_sources = files([
'gskpathbuilder.c',
'gskpathintersect.c',
'gskpathmeasure.c',
'gskpathops.c',
'gskpathparser.c',
'gskpathpoint.c',
'gskrenderer.c',