Implement stroking

Implement gsk_contour_default_add_stroke, which takes a contour
and stroke parameters, and adds contours to a path builder for
the outline that would be produced by stroking the path with these
parameters.

The current implementation does not try to handle short segments
in the vicinity of sharp joins in any special way, so there can
be some artifacts in that situation.
This commit is contained in:
Matthias Clasen
2023-06-11 22:55:13 -04:00
parent 14411b0428
commit cd6d88fca5
5 changed files with 2263 additions and 0 deletions

View File

@@ -555,6 +555,8 @@ gsk_rect_contour_add_stroke (const GskContour *contour,
rect.size.width = - rect.size.width;
gsk_path_builder_add_rect (builder, &rect);
}
else
gsk_contour_default_add_stroke (contour, builder, stroke);
}
static void
@@ -1016,6 +1018,8 @@ gsk_circle_contour_add_stroke (const GskContour *contour,
self->start_angle);
gsk_path_builder_add_contour (builder, c);
}
else
gsk_contour_default_add_stroke (contour, builder, stroke);
}
static void
@@ -1891,6 +1895,7 @@ gsk_standard_contour_add_stroke (const GskContour *contour,
GskPathBuilder *builder,
GskStroke *stroke)
{
gsk_contour_default_add_stroke (contour, builder, stroke);
}
static void

View File

@@ -40,6 +40,7 @@
* The `GskPathBuilder` structure is meant to help in this endeavor.
*/
struct _GskPath
{
/*< private >*/

View File

@@ -20,6 +20,7 @@
#include "config.h"
#include "gskpathmeasure.h"
#include "gskpathbuilder.h"
#include "gskpathbuilder.h"
#include "gskpathprivate.h"

2255
gsk/gskpathstroke.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,7 @@ gsk_public_sources = files([
'gskpathbuilder.c',
'gskpathdash.c',
'gskpathmeasure.c',
'gskpathstroke.c',
'gskrenderer.c',
'gskrendernode.c',
'gskrendernodeimpl.c',