summaryrefslogtreecommitdiff
path: root/src/cairo-path-fill.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-08-04 22:45:59 +0000
committerKristian Høgsberg <krh@redhat.com>2005-08-04 22:45:59 +0000
commitebf985c87688f090c27c3906a6b441522b2f702a (patch)
tree4ed92acbdfb22a6c1204d77bb0761923ace5a4b6 /src/cairo-path-fill.c
parent27573750eb9f2655d0b4cb5640a9f3f6c1316bc0 (diff)
downloadcairo-ebf985c87688f090c27c3906a6b441522b2f702a.tar.gz
New files. Move code for manipulating cairo_clip_t out into cairo_clip_* functions and put them in cairo-clip.c.
Rewrite to use new cairo_clip_t functions for manipulating the clip state, change the clip_and_composite_trapezoids call tree to use cairo_clip_t instead of cairo_gstate_t. Use new cairo_clip_t function to maintain clip state while replaying. Pass fill rule and tolerance directly, to break gstate dependency. New function. Set the clip for a surface as specified by the cairo_clip_t. Move translate_traps() from cairo-gstate.c to here and rename it. Reviewed by: otaylor
Diffstat (limited to 'src/cairo-path-fill.c')
-rw-r--r--src/cairo-path-fill.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
index c0015fc96..31b83ade3 100644
--- a/src/cairo-path-fill.c
+++ b/src/cairo-path-fill.c
@@ -36,10 +36,8 @@
#include "cairoint.h"
-#include "cairo-gstate-private.h"
-
typedef struct cairo_filler {
- cairo_gstate_t *gstate;
+ double tolerance;
cairo_traps_t *traps;
cairo_point_t current_point;
@@ -48,7 +46,7 @@ typedef struct cairo_filler {
} cairo_filler_t;
static void
-_cairo_filler_init (cairo_filler_t *filler, cairo_gstate_t *gstate, cairo_traps_t *traps);
+_cairo_filler_init (cairo_filler_t *filler, double tolerance, cairo_traps_t *traps);
static void
_cairo_filler_fini (cairo_filler_t *filler);
@@ -69,9 +67,9 @@ static cairo_status_t
_cairo_filler_close_path (void *closure);
static void
-_cairo_filler_init (cairo_filler_t *filler, cairo_gstate_t *gstate, cairo_traps_t *traps)
+_cairo_filler_init (cairo_filler_t *filler, double tolerance, cairo_traps_t *traps)
{
- filler->gstate = gstate;
+ filler->tolerance = tolerance;
filler->traps = traps;
filler->current_point.x = 0;
@@ -132,7 +130,6 @@ _cairo_filler_curve_to (void *closure,
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_filler_t *filler = closure;
cairo_polygon_t *polygon = &filler->polygon;
- cairo_gstate_t *gstate = filler->gstate;
cairo_spline_t spline;
status = _cairo_spline_init (&spline, &filler->current_point, b, c, d);
@@ -140,7 +137,7 @@ _cairo_filler_curve_to (void *closure,
if (status == CAIRO_INT_STATUS_DEGENERATE)
return CAIRO_STATUS_SUCCESS;
- _cairo_spline_decompose (&spline, gstate->tolerance);
+ _cairo_spline_decompose (&spline, filler->tolerance);
if (status)
goto CLEANUP_SPLINE;
@@ -174,13 +171,14 @@ _cairo_filler_close_path (void *closure)
cairo_status_t
_cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
- cairo_gstate_t *gstate,
+ cairo_fill_rule_t fill_rule,
+ double tolerance,
cairo_traps_t *traps)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_filler_t filler;
- _cairo_filler_init (&filler, gstate, traps);
+ _cairo_filler_init (&filler, tolerance, traps);
status = _cairo_path_fixed_interpret (path,
CAIRO_DIRECTION_FORWARD,
@@ -198,7 +196,7 @@ _cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
status = _cairo_traps_tessellate_polygon (filler.traps,
&filler.polygon,
- filler.gstate->fill_rule);
+ fill_rule);
if (status)
goto BAIL;