diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-11-01 19:49:19 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-11-01 22:27:34 +0000 |
commit | 2a25e226588404da2970f473bdeb0d2ce106ce58 (patch) | |
tree | 6d16af3bb4da26c31a352e40718c2950e7ac2c77 /src/cairoint.h | |
parent | b311c414a27b7374540671b3ef7153b30def0451 (diff) |
[cairo-spline] Reduce stack requirements during recursive refinement.
By splitting out the knot vectors into a smaller, separate structure, we
can dramatically reduce the stack allocation for each level of recursion.
Secondly we can have the storage requirements by modifying the first set
of knots in-place, thus we need only allocate stack space for the knots
covering the deferred half of the spline.
Diffstat (limited to 'src/cairoint.h')
-rw-r--r-- | src/cairoint.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cairoint.h b/src/cairoint.h index 225cb4bcd..bde8f6b63 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -283,8 +283,11 @@ typedef struct _cairo_polygon { cairo_edge_t edges_embedded[8]; } cairo_polygon_t; -typedef struct _cairo_spline { +typedef struct _cairo_spline_knots { cairo_point_t a, b, c, d; +} cairo_spline_knots_t; +typedef struct _cairo_spline { + cairo_spline_knots_t knots; cairo_slope_t initial_slope; cairo_slope_t final_slope; @@ -2086,10 +2089,10 @@ _cairo_polygon_close (cairo_polygon_t *polygon); /* cairo_spline.c */ cairo_private cairo_int_status_t _cairo_spline_init (cairo_spline_t *spline, - cairo_point_t *a, - cairo_point_t *b, - cairo_point_t *c, - cairo_point_t *d); + const cairo_point_t *a, + const cairo_point_t *b, + const cairo_point_t *c, + const cairo_point_t *d); cairo_private cairo_status_t _cairo_spline_decompose (cairo_spline_t *spline, double tolerance); |