Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
cairo-path-fill.c File Reference
#include "cairoint.h"

Go to the source code of this file.

Classes

struct  cairo_filler

Typedefs

typedef struct cairo_filler cairo_filler_t

Functions

static void _cairo_filler_init (cairo_filler_t *filler, double tolerance, cairo_traps_t *traps)
static void _cairo_filler_fini (cairo_filler_t *filler)
static cairo_status_t _cairo_filler_move_to (void *closure, cairo_point_t *point)
static cairo_status_t _cairo_filler_line_to (void *closure, cairo_point_t *point)
static cairo_status_t _cairo_filler_curve_to (void *closure, cairo_point_t *b, cairo_point_t *c, cairo_point_t *d)
static cairo_status_t _cairo_filler_close_path (void *closure)
cairo_status_t _cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path, cairo_fill_rule_t fill_rule, double tolerance, cairo_traps_t *traps)

Class Documentation

struct cairo_filler

Definition at line 39 of file cairo-path-fill.c.

Collaboration diagram for cairo_filler:
Class Members
cairo_point_t current_point
cairo_polygon_t polygon
double tolerance
cairo_traps_t * traps

Typedef Documentation

typedef struct cairo_filler cairo_filler_t

Function Documentation

static cairo_status_t _cairo_filler_close_path ( void closure) [static]

Definition at line 159 of file cairo-path-fill.c.

{
    cairo_status_t status;
    cairo_filler_t *filler = closure;
    cairo_polygon_t *polygon = &filler->polygon;

    status = _cairo_polygon_close (polygon);
    if (status)
       return status;

    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static cairo_status_t _cairo_filler_curve_to ( void closure,
cairo_point_t b,
cairo_point_t c,
cairo_point_t d 
) [static]

Definition at line 124 of file cairo-path-fill.c.

{
    int i;
    cairo_status_t status = CAIRO_STATUS_SUCCESS;
    cairo_filler_t *filler = closure;
    cairo_polygon_t *polygon = &filler->polygon;
    cairo_spline_t spline;

    status = _cairo_spline_init (&spline, &filler->current_point, b, c, d);

    if (status == CAIRO_INT_STATUS_DEGENERATE)
       return CAIRO_STATUS_SUCCESS;

    _cairo_spline_decompose (&spline, filler->tolerance);
    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;
    }

  CLEANUP_SPLINE:
    _cairo_spline_fini (&spline);

    filler->current_point = *d;

    return status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void _cairo_filler_fini ( cairo_filler_t filler) [static]

Definition at line 82 of file cairo-path-fill.c.

{
    _cairo_polygon_fini (&filler->polygon);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void _cairo_filler_init ( cairo_filler_t filler,
double  tolerance,
cairo_traps_t traps 
) [static]

Definition at line 70 of file cairo-path-fill.c.

{
    filler->tolerance = tolerance;
    filler->traps = traps;

    filler->current_point.x = 0;
    filler->current_point.y = 0;

    _cairo_polygon_init (&filler->polygon);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static cairo_status_t _cairo_filler_line_to ( void closure,
cairo_point_t point 
) [static]

Definition at line 108 of file cairo-path-fill.c.

{
    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;

    filler->current_point = *point;

    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static cairo_status_t _cairo_filler_move_to ( void closure,
cairo_point_t point 
) [static]

Definition at line 88 of file cairo-path-fill.c.

{
    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;

    filler->current_point = *point;

    return CAIRO_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cairo_status_t _cairo_path_fixed_fill_to_traps ( cairo_path_fixed_t *  path,
cairo_fill_rule_t  fill_rule,
double  tolerance,
cairo_traps_t traps 
)

Definition at line 173 of file cairo-path-fill.c.

{
    cairo_status_t status = CAIRO_STATUS_SUCCESS;
    cairo_filler_t filler;

    _cairo_filler_init (&filler, tolerance, traps);

    status = _cairo_path_fixed_interpret (path,
                                     CAIRO_DIRECTION_FORWARD,
                                     _cairo_filler_move_to,
                                     _cairo_filler_line_to,
                                     _cairo_filler_curve_to,
                                     _cairo_filler_close_path,
                                     &filler);
    if (status)
       goto BAIL;

    status = _cairo_polygon_close (&filler.polygon);
    if (status)
       goto BAIL;

    status = _cairo_traps_tessellate_polygon (filler.traps,
                                         &filler.polygon,
                                         fill_rule);
    if (status)
       goto BAIL;

BAIL:
    _cairo_filler_fini (&filler);

    return status;
}

Here is the call graph for this function:

Here is the caller graph for this function: