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 0e6da01d05
commit a2c35d8682
3 changed files with 1743 additions and 0 deletions

1727
gsk/gskpathops.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -61,5 +61,20 @@ gboolean gsk_path_get_stroke_bounds (GskPath
const GskStroke *stroke,
graphene_rect_t *bounds);
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

@@ -29,6 +29,7 @@ gsk_public_sources = files([
'gskpath.c',
'gskpathbuilder.c',
'gskpathmeasure.c',
'gskpathops.c',
'gskpathpoint.c',
'gskpathstroke.c',
'gskrenderer.c',