diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index dcff2fcb87..8d6fe48af5 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -4567,6 +4567,7 @@ struct _GskStrokeNode GskRenderNode *child; GskPath *path; + GskPath *stroke_path; GskStroke stroke; }; @@ -4578,6 +4579,7 @@ gsk_stroke_node_finalize (GskRenderNode *node) gsk_render_node_unref (self->child); gsk_path_unref (self->path); + gsk_path_unref (self->stroke_path); gsk_stroke_clear (&self->stroke); parent_class->finalize (node); @@ -4673,6 +4675,7 @@ gsk_stroke_node_new (GskRenderNode *child, self->child = gsk_render_node_ref (child); self->path = gsk_path_ref (path); gsk_stroke_init_copy (&self->stroke, stroke); + self->stroke_path = gsk_path_stroke (path, &self->stroke); if (gsk_path_get_stroke_bounds (self->path, &self->stroke, &stroke_bounds)) graphene_rect_intersection (&stroke_bounds, &child->bounds, &node->bounds); @@ -4719,6 +4722,16 @@ gsk_stroke_node_get_path (const GskRenderNode *node) return self->path; } +GskPath * +gsk_stroke_node_get_stroke_path (const GskRenderNode *node) +{ + const GskStrokeNode *self = (const GskStrokeNode *) node; + + g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_STROKE_NODE), NULL); + + return self->stroke_path; +} + /** * gsk_stroke_node_get_stroke: * @node: (type GskStrokeNode): a stroke #GskRenderNode diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h index 4ad79bd593..f746af0025 100644 --- a/gsk/gskrendernodeprivate.h +++ b/gsk/gskrendernodeprivate.h @@ -87,6 +87,7 @@ gboolean gsk_container_node_is_disjoint (const GskRenderNode gboolean gsk_render_node_use_offscreen_for_opacity (const GskRenderNode *node); +GskPath * gsk_stroke_node_get_stroke_path (const GskRenderNode *node); G_END_DECLS