summaryrefslogtreecommitdiff
path: root/src/cairo-path-stroke.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-03-28 14:57:44 +0100
committerCarl Worth <cworth@cworth.org>2007-04-09 15:51:31 -0700
commit3f7ca6ef5b09263607ff2f9862950393815c5d2c (patch)
treea2991a3c5e22befe6dc1f0d2b971ed799da50360 /src/cairo-path-stroke.c
parent67f13b3518c5fc98d1e3fb184bc6c2f5ea96f4c9 (diff)
cairo-pen - cairo_pen_init() can fail propagate its error.
Add status returns in order to propagate an intialisation failure back up the call chain.
Diffstat (limited to 'src/cairo-path-stroke.c')
-rw-r--r--src/cairo-path-stroke.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index 7b61152a..c5a83421 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -67,7 +67,7 @@ typedef struct cairo_stroker {
} cairo_stroker_t;
/* private functions */
-static void
+static cairo_status_t
_cairo_stroker_init (cairo_stroker_t *stroker,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -148,7 +148,7 @@ _cairo_stroker_step_dash (cairo_stroker_t *stroker, double step)
}
}
-static void
+static cairo_status_t
_cairo_stroker_init (cairo_stroker_t *stroker,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -156,15 +156,18 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
double tolerance,
cairo_traps_t *traps)
{
+ cairo_status_t status;
stroker->style = stroke_style;
stroker->ctm = ctm;
stroker->ctm_inverse = ctm_inverse;
stroker->tolerance = tolerance;
stroker->traps = traps;
- _cairo_pen_init (&stroker->pen,
- stroke_style->line_width / 2.0,
- tolerance, ctm);
+ status = _cairo_pen_init (&stroker->pen,
+ stroke_style->line_width / 2.0,
+ tolerance, ctm);
+ if (status)
+ return status;
stroker->has_current_face = FALSE;
stroker->has_first_face = FALSE;
@@ -174,6 +177,8 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
_cairo_stroker_start_dash (stroker);
else
stroker->dashed = FALSE;
+
+ return CAIRO_STATUS_SUCCESS;
}
static void
@@ -984,9 +989,11 @@ _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
return status;
- _cairo_stroker_init (&stroker, stroke_style,
- ctm, ctm_inverse, tolerance,
- traps);
+ status = _cairo_stroker_init (&stroker, stroke_style,
+ ctm, ctm_inverse, tolerance,
+ traps);
+ if (status)
+ return status;
if (stroker.style->dash)
status = _cairo_path_fixed_interpret (path,