summaryrefslogtreecommitdiff
path: root/src/cairo-path-fill.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2007-04-10 10:45:15 -0700
committerCarl Worth <cworth@cworth.org>2007-04-10 10:45:15 -0700
commitb1086caf3b108b0df19f70a2b6df161ad51bb280 (patch)
treeafd4c39feb6628539a37e9ba7155f739ca5520e6 /src/cairo-path-fill.c
parentbff45ec9f90b5949a8ffa19cb03c140a08119e4d (diff)
downloadcairo-b1086caf3b108b0df19f70a2b6df161ad51bb280.tar.gz
Add a status field to cairo_polygon_t
Now, the functions to add new data to a polygon all become void, and there's a new _cairo_polygon_status call to query the status at the end of a sequence of operations. With this change, we fix many callerswhich were previously not checking the return values of _cairo_polygon functions by adding only a single call to _cairo_polygon_status rathern than several new checks.
Diffstat (limited to 'src/cairo-path-fill.c')
-rw-r--r--src/cairo-path-fill.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
index d2a9118af..25420297f 100644
--- a/src/cairo-path-fill.c
+++ b/src/cairo-path-fill.c
@@ -88,37 +88,28 @@ _cairo_filler_fini (cairo_filler_t *filler)
static cairo_status_t
_cairo_filler_move_to (void *closure, cairo_point_t *point)
{
- cairo_status_t status;
cairo_filler_t *filler = closure;
cairo_polygon_t *polygon = &filler->polygon;
- status = _cairo_polygon_close (polygon);
- if (status)
- return status;
-
- status = _cairo_polygon_move_to (polygon, point);
- if (status)
- return status;
+ _cairo_polygon_close (polygon);
+ _cairo_polygon_move_to (polygon, point);
filler->current_point = *point;
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_polygon_status (&filler->polygon);
}
static cairo_status_t
_cairo_filler_line_to (void *closure, cairo_point_t *point)
{
- cairo_status_t status;
cairo_filler_t *filler = closure;
cairo_polygon_t *polygon = &filler->polygon;
- status = _cairo_polygon_line_to (polygon, point);
- if (status)
- return status;
+ _cairo_polygon_line_to (polygon, point);
filler->current_point = *point;
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_polygon_status (&filler->polygon);
}
static cairo_status_t
@@ -142,11 +133,8 @@ _cairo_filler_curve_to (void *closure,
if (status)
goto CLEANUP_SPLINE;
- for (i = 1; i < spline.num_points; i++) {
- status = _cairo_polygon_line_to (polygon, &spline.points[i]);
- if (status)
- break;
- }
+ for (i = 1; i < spline.num_points; i++)
+ _cairo_polygon_line_to (polygon, &spline.points[i]);
CLEANUP_SPLINE:
_cairo_spline_fini (&spline);
@@ -159,15 +147,12 @@ _cairo_filler_curve_to (void *closure,
static cairo_status_t
_cairo_filler_close_path (void *closure)
{
- cairo_status_t status;
cairo_filler_t *filler = closure;
cairo_polygon_t *polygon = &filler->polygon;
- status = _cairo_polygon_close (polygon);
- if (status)
- return status;
+ _cairo_polygon_close (polygon);
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_polygon_status (polygon);
}
static cairo_int_status_t
@@ -201,7 +186,8 @@ _cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
if (status)
goto BAIL;
- status = _cairo_polygon_close (&filler.polygon);
+ _cairo_polygon_close (&filler.polygon);
+ status = _cairo_polygon_status (&filler.polygon);
if (status)
goto BAIL;