summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-05-09 13:13:52 +0200
committerBehdad Esfahbod <behdad@behdad.org>2008-05-09 15:54:11 +0200
commit0e965c970bd310bd8f06cd59ed0cf631ae88659a (patch)
tree43ba14295f7fed82de9475894c64013e62d9fee9 /src/cairo-path-fixed.c
parente9b6bb06d60584a867256e52732aad25c9e137c5 (diff)
[cairo-path-fixed] Add _cairo_path_fixed_append()
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 43b80407..ec62281d 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -541,6 +541,52 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
return CAIRO_STATUS_SUCCESS;
}
+static cairo_status_t
+_append_move_to (void *closure,
+ cairo_point_t *point)
+{
+ cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
+ return _cairo_path_fixed_move_to (path, point->x, point->y);
+}
+
+static cairo_status_t
+_append_line_to (void *closure,
+ cairo_point_t *point)
+{
+ cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
+ return _cairo_path_fixed_line_to (path, point->x, point->y);
+}
+
+static cairo_status_t
+_append_curve_to (void *closure,
+ cairo_point_t *p0,
+ cairo_point_t *p1,
+ cairo_point_t *p2)
+{
+ cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
+ return _cairo_path_fixed_curve_to (path, p0->x, p0->y, p1->x, p1->y, p2->x, p2->y);
+}
+
+static cairo_status_t
+_append_close_path (void *closure)
+{
+ cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
+ return _cairo_path_fixed_close_path (path);
+}
+
+cairo_private cairo_status_t
+_cairo_path_fixed_append (cairo_path_fixed_t *path,
+ const cairo_path_fixed_t *other,
+ cairo_direction_t dir)
+{
+ return _cairo_path_fixed_interpret (other, dir,
+ _append_move_to,
+ _append_line_to,
+ _append_curve_to,
+ _append_close_path,
+ path);
+}
+
static void
_cairo_path_fixed_offset_and_scale (cairo_path_fixed_t *path,
cairo_fixed_t offx,