mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-01 18:28:00 +02:00
[path] Mark points as const during _cairo_path_fixed_interpret()
Use const to document the read-only nature of the arguments passed to the callbacks.
This commit is contained in:
parent
68b29cafa5
commit
bcb2724920
18 changed files with 188 additions and 247 deletions
|
|
@ -47,24 +47,6 @@ typedef struct cairo_path_bounder {
|
|||
cairo_fixed_t max_y;
|
||||
} cairo_path_bounder_t;
|
||||
|
||||
static void
|
||||
_cairo_path_bounder_init (cairo_path_bounder_t *bounder);
|
||||
|
||||
static void
|
||||
_cairo_path_bounder_fini (cairo_path_bounder_t *bounder);
|
||||
|
||||
static void
|
||||
_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_move_to (void *closure, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_line_to (void *closure, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_close_path (void *closure);
|
||||
|
||||
static void
|
||||
_cairo_path_bounder_init (cairo_path_bounder_t *bounder)
|
||||
{
|
||||
|
|
@ -80,7 +62,8 @@ _cairo_path_bounder_fini (cairo_path_bounder_t *bounder)
|
|||
}
|
||||
|
||||
static void
|
||||
_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point)
|
||||
_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
if (bounder->has_point) {
|
||||
if (point->x < bounder->min_x)
|
||||
|
|
@ -105,7 +88,8 @@ _cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *poi
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_path_bounder_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_path_bounder_t *bounder = closure;
|
||||
|
||||
|
|
@ -116,7 +100,8 @@ _cairo_path_bounder_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_path_bounder_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_path_bounder_t *bounder = closure;
|
||||
|
||||
|
|
@ -133,9 +118,9 @@ _cairo_path_bounder_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_path_bounder_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
cairo_path_bounder_t *bounder = closure;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,27 +46,6 @@ typedef struct cairo_filler {
|
|||
cairo_polygon_t polygon;
|
||||
} cairo_filler_t;
|
||||
|
||||
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);
|
||||
|
||||
static void
|
||||
_cairo_filler_init (cairo_filler_t *filler, double tolerance, cairo_traps_t *traps)
|
||||
{
|
||||
|
|
@ -86,7 +65,8 @@ _cairo_filler_fini (cairo_filler_t *filler)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_filler_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_filler_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_filler_t *filler = closure;
|
||||
cairo_polygon_t *polygon = &filler->polygon;
|
||||
|
|
@ -100,7 +80,8 @@ _cairo_filler_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_filler_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_filler_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_filler_t *filler = closure;
|
||||
cairo_polygon_t *polygon = &filler->polygon;
|
||||
|
|
@ -114,9 +95,9 @@ _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)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
cairo_filler_t *filler = closure;
|
||||
cairo_spline_t spline;
|
||||
|
|
|
|||
|
|
@ -707,7 +707,7 @@ _cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
|||
|
||||
static cairo_status_t
|
||||
_append_move_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
|
||||
return _cairo_path_fixed_move_to (path, point->x, point->y);
|
||||
|
|
@ -715,7 +715,7 @@ _append_move_to (void *closure,
|
|||
|
||||
static cairo_status_t
|
||||
_append_line_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
|
||||
return _cairo_path_fixed_line_to (path, point->x, point->y);
|
||||
|
|
@ -723,9 +723,9 @@ _append_line_to (void *closure,
|
|||
|
||||
static cairo_status_t
|
||||
_append_curve_to (void *closure,
|
||||
cairo_point_t *p0,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2)
|
||||
const cairo_point_t *p0,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
cairo_path_fixed_t *path = (cairo_path_fixed_t *) closure;
|
||||
return _cairo_path_fixed_curve_to (path, p0->x, p0->y, p1->x, p1->y, p2->x, p2->y);
|
||||
|
|
@ -738,7 +738,7 @@ _append_close_path (void *closure)
|
|||
return _cairo_path_fixed_close_path (path);
|
||||
}
|
||||
|
||||
cairo_private cairo_status_t
|
||||
cairo_status_t
|
||||
_cairo_path_fixed_append (cairo_path_fixed_t *path,
|
||||
const cairo_path_fixed_t *other,
|
||||
cairo_direction_t dir)
|
||||
|
|
@ -864,7 +864,8 @@ typedef struct cairo_path_flattener {
|
|||
} cpf_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cpf_move_to (void *closure, cairo_point_t *point)
|
||||
_cpf_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpf_t *cpf = closure;
|
||||
|
||||
|
|
@ -874,7 +875,8 @@ _cpf_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cpf_line_to (void *closure, cairo_point_t *point)
|
||||
_cpf_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpf_t *cpf = closure;
|
||||
|
||||
|
|
@ -885,9 +887,9 @@ _cpf_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cpf_curve_to (void *closure,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2,
|
||||
cairo_point_t *p3)
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2,
|
||||
const cairo_point_t *p3)
|
||||
{
|
||||
cpf_t *cpf = closure;
|
||||
cairo_spline_t spline;
|
||||
|
|
@ -1191,22 +1193,23 @@ typedef struct cairo_path_region_tester {
|
|||
|
||||
static cairo_status_t
|
||||
_cprt_line_to (void *closure,
|
||||
cairo_point_t *p2)
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
cprt_t *self = closure;
|
||||
cairo_point_t *p1 = &self->current_point;
|
||||
|
||||
if (p2->x == p1->x) {
|
||||
if (_cairo_fixed_is_integer(p2->y)) {
|
||||
*p1 = *p2;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
else if (p2->y == p1->y) {
|
||||
if (_cairo_fixed_is_integer(p2->x)) {
|
||||
*p1 = *p2;
|
||||
if (_cairo_fixed_is_integer (p2->y)) {
|
||||
p1->y = p2->y;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
} else if (p2->y == p1->y) {
|
||||
if (_cairo_fixed_is_integer (p2->x)) {
|
||||
p1->x = p2->x;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
|
@ -1218,32 +1221,22 @@ _cprt_close_path (void *closure)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cprt_move_to (void *closure,
|
||||
cairo_point_t *p)
|
||||
_cprt_move_to (void *closure,
|
||||
const cairo_point_t *p)
|
||||
{
|
||||
cprt_t *self = closure;
|
||||
cairo_status_t status = _cprt_close_path (closure);
|
||||
if (status) return status;
|
||||
if (_cairo_fixed_is_integer(p->x) &&
|
||||
_cairo_fixed_is_integer(p->y))
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cprt_close_path (closure);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (_cairo_fixed_is_integer (p->x) && _cairo_fixed_is_integer (p->y)) {
|
||||
self->current_point = *p;
|
||||
self->last_move_point = *p;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cprt_curve_to (void *closure,
|
||||
cairo_point_t *p0,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2)
|
||||
{
|
||||
(void)closure;
|
||||
(void)p0;
|
||||
(void)p1;
|
||||
(void)p2;
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
|
@ -1256,19 +1249,20 @@ cairo_bool_t
|
|||
_cairo_path_fixed_is_region (cairo_path_fixed_t *path)
|
||||
{
|
||||
cprt_t cprt;
|
||||
cairo_status_t status;
|
||||
|
||||
if (path->has_curve_to)
|
||||
return FALSE;
|
||||
|
||||
cprt.current_point.x = 0;
|
||||
cprt.current_point.y = 0;
|
||||
cprt.last_move_point.x = 0;
|
||||
cprt.last_move_point.y = 0;
|
||||
status = _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cprt_move_to,
|
||||
_cprt_line_to,
|
||||
_cprt_curve_to,
|
||||
_cprt_close_path,
|
||||
&cprt);
|
||||
return status == CAIRO_STATUS_SUCCESS;
|
||||
|
||||
return _cairo_path_fixed_interpret (path,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cprt_move_to,
|
||||
_cprt_line_to,
|
||||
NULL,
|
||||
_cprt_close_path,
|
||||
&cprt) == CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,8 @@ _cairo_in_fill_add_edge (cairo_in_fill_t *in_fill,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_in_fill_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_in_fill_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_in_fill_t *in_fill = closure;
|
||||
|
||||
|
|
@ -151,7 +152,8 @@ _cairo_in_fill_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_in_fill_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_in_fill_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_in_fill_t *in_fill = closure;
|
||||
|
||||
|
|
@ -166,9 +168,9 @@ _cairo_in_fill_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_in_fill_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
cairo_in_fill_t *in_fill = closure;
|
||||
cairo_spline_t spline;
|
||||
|
|
|
|||
|
|
@ -72,51 +72,6 @@ typedef struct cairo_stroker {
|
|||
cairo_box_t bounds;
|
||||
} cairo_stroker_t;
|
||||
|
||||
/* private functions */
|
||||
static cairo_status_t
|
||||
_cairo_stroker_init (cairo_stroker_t *stroker,
|
||||
cairo_stroke_style_t *stroke_style,
|
||||
cairo_matrix_t *ctm,
|
||||
cairo_matrix_t *ctm_inverse,
|
||||
double tolerance,
|
||||
cairo_traps_t *traps);
|
||||
|
||||
static void
|
||||
_cairo_stroker_fini (cairo_stroker_t *stroker);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_move_to (void *closure, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_line_to (void *closure, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_curve_to_dashed (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_close_path (void *closure);
|
||||
|
||||
static void
|
||||
_translate_point (cairo_point_t *point, cairo_point_t *offset);
|
||||
|
||||
static int
|
||||
_cairo_stroker_face_clockwise (cairo_stroke_face_t *in, cairo_stroke_face_t *out);
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_stroke_face_t *out);
|
||||
|
||||
static void
|
||||
_cairo_stroker_start_dash (cairo_stroker_t *stroker)
|
||||
{
|
||||
|
|
@ -632,7 +587,7 @@ _compute_normalized_device_slope (double *dx, double *dy, cairo_matrix_t *ctm_in
|
|||
}
|
||||
|
||||
static void
|
||||
_compute_face (cairo_point_t *point, cairo_slope_t *dev_slope,
|
||||
_compute_face (const cairo_point_t *point, cairo_slope_t *dev_slope,
|
||||
double slope_dx, double slope_dy,
|
||||
cairo_stroker_t *stroker, cairo_stroke_face_t *face);
|
||||
|
||||
|
|
@ -681,7 +636,7 @@ _cairo_stroker_add_caps (cairo_stroker_t *stroker)
|
|||
}
|
||||
|
||||
static void
|
||||
_compute_face (cairo_point_t *point, cairo_slope_t *dev_slope,
|
||||
_compute_face (const cairo_point_t *point, cairo_slope_t *dev_slope,
|
||||
double slope_dx, double slope_dy,
|
||||
cairo_stroker_t *stroker, cairo_stroke_face_t *face)
|
||||
{
|
||||
|
|
@ -729,9 +684,13 @@ _compute_face (cairo_point_t *point, cairo_slope_t *dev_slope,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_point_t *p2,
|
||||
cairo_slope_t *dev_slope, double slope_dx, double slope_dy,
|
||||
cairo_stroke_face_t *start, cairo_stroke_face_t *end)
|
||||
_cairo_stroker_add_sub_edge (cairo_stroker_t *stroker,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2,
|
||||
cairo_slope_t *dev_slope,
|
||||
double slope_dx, double slope_dy,
|
||||
cairo_stroke_face_t *start,
|
||||
cairo_stroke_face_t *end)
|
||||
{
|
||||
cairo_point_t rectangle[4];
|
||||
|
||||
|
|
@ -754,7 +713,8 @@ _cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_stroker_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_stroker_t *stroker = closure;
|
||||
|
|
@ -775,7 +735,8 @@ _cairo_stroker_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_move_to_dashed (void *closure, cairo_point_t *point)
|
||||
_cairo_stroker_move_to_dashed (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
/* reset the dash pattern for new sub paths */
|
||||
cairo_stroker_t *stroker = closure;
|
||||
|
|
@ -785,13 +746,13 @@ _cairo_stroker_move_to_dashed (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_stroker_line_to (void *closure,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_stroker_t *stroker = closure;
|
||||
cairo_stroke_face_t start, end;
|
||||
cairo_point_t *p1 = &stroker->current_point;
|
||||
cairo_point_t *p2 = point;
|
||||
cairo_slope_t dev_slope;
|
||||
double slope_dx, slope_dy;
|
||||
|
||||
|
|
@ -805,7 +766,11 @@ _cairo_stroker_line_to (void *closure, cairo_point_t *point)
|
|||
slope_dy = _cairo_fixed_to_double (p2->y - p1->y);
|
||||
_compute_normalized_device_slope (&slope_dx, &slope_dy, stroker->ctm_inverse, NULL);
|
||||
|
||||
status = _cairo_stroker_add_sub_edge (stroker, p1, p2, &dev_slope, slope_dx, slope_dy, &start, &end);
|
||||
status = _cairo_stroker_add_sub_edge (stroker,
|
||||
p1, p2,
|
||||
&dev_slope,
|
||||
slope_dx, slope_dy,
|
||||
&start, &end);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
|
|
@ -822,7 +787,7 @@ _cairo_stroker_line_to (void *closure, cairo_point_t *point)
|
|||
stroker->current_face = end;
|
||||
stroker->has_current_face = TRUE;
|
||||
|
||||
stroker->current_point = *point;
|
||||
stroker->current_point = *p2;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
@ -831,7 +796,8 @@ _cairo_stroker_line_to (void *closure, cairo_point_t *point)
|
|||
* Dashed lines. Cap each dash end, join around turns when on
|
||||
*/
|
||||
static cairo_status_t
|
||||
_cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
|
||||
_cairo_stroker_line_to_dashed (void *closure,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
cairo_stroker_t *stroker = closure;
|
||||
double mag, remain, step_length = 0;
|
||||
|
|
@ -839,7 +805,6 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
|
|||
double dx2, dy2;
|
||||
cairo_stroke_face_t sub_start, sub_end;
|
||||
cairo_point_t *p1 = &stroker->current_point;
|
||||
cairo_point_t *p2 = point;
|
||||
cairo_slope_t dev_slope;
|
||||
cairo_line_t segment;
|
||||
cairo_bool_t fully_in_bounds;
|
||||
|
|
@ -948,7 +913,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
|
|||
* path stroking.
|
||||
* On the other hand, Acroread 7 also produces the degenerate caps.
|
||||
*/
|
||||
_compute_face (point, &dev_slope,
|
||||
_compute_face (p2, &dev_slope,
|
||||
slope_dx, slope_dy,
|
||||
stroker,
|
||||
&stroker->current_face);
|
||||
|
|
@ -961,16 +926,16 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
|
|||
stroker->has_current_face = TRUE;
|
||||
}
|
||||
|
||||
stroker->current_point = *point;
|
||||
stroker->current_point = *p2;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_stroker_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
cairo_stroker_t *stroker = closure;
|
||||
cairo_pen_stroke_spline_t spline_pen;
|
||||
|
|
@ -1072,9 +1037,9 @@ _cairo_stroker_curve_to (void *closure,
|
|||
*/
|
||||
static cairo_status_t
|
||||
_cairo_stroker_curve_to_dashed (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
cairo_stroker_t *stroker = closure;
|
||||
cairo_spline_t spline;
|
||||
|
|
@ -1242,8 +1207,8 @@ _cairo_rectilinear_stroker_fini (cairo_rectilinear_stroker_t *stroker)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_rectilinear_stroker_add_segment (cairo_rectilinear_stroker_t *stroker,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2)
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
|
||||
if (stroker->num_segments == stroker->segments_size) {
|
||||
|
|
@ -1395,7 +1360,7 @@ _cairo_rectilinear_stroker_emit_segments (cairo_rectilinear_stroker_t *stroker)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_rectilinear_stroker_move_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_rectilinear_stroker_t *stroker = closure;
|
||||
cairo_status_t status;
|
||||
|
|
@ -1412,11 +1377,10 @@ _cairo_rectilinear_stroker_move_to (void *closure,
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_rectilinear_stroker_line_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
const cairo_point_t *b)
|
||||
{
|
||||
cairo_rectilinear_stroker_t *stroker = closure;
|
||||
cairo_point_t *a = &stroker->current_point;
|
||||
cairo_point_t *b = point;
|
||||
cairo_status_t status;
|
||||
|
||||
/* We only support horizontal or vertical elements. */
|
||||
|
|
@ -1429,7 +1393,7 @@ _cairo_rectilinear_stroker_line_to (void *closure,
|
|||
|
||||
status = _cairo_rectilinear_stroker_add_segment (stroker, a, b);
|
||||
|
||||
stroker->current_point = *point;
|
||||
stroker->current_point = *b;
|
||||
stroker->open_sub_path = TRUE;
|
||||
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ typedef struct cairo_path_count {
|
|||
} cpc_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cpc_move_to (void *closure, cairo_point_t *point)
|
||||
_cpc_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpc_t *cpc = closure;
|
||||
|
||||
|
|
@ -60,7 +61,8 @@ _cpc_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cpc_line_to (void *closure, cairo_point_t *point)
|
||||
_cpc_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpc_t *cpc = closure;
|
||||
|
||||
|
|
@ -73,9 +75,9 @@ _cpc_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cpc_curve_to (void *closure,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2,
|
||||
cairo_point_t *p3)
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2,
|
||||
const cairo_point_t *p3)
|
||||
{
|
||||
cpc_t *cpc = closure;
|
||||
|
||||
|
|
@ -141,7 +143,8 @@ typedef struct cairo_path_populate {
|
|||
} cpp_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cpp_move_to (void *closure, cairo_point_t *point)
|
||||
_cpp_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpp_t *cpp = closure;
|
||||
cairo_path_data_t *data = cpp->data;
|
||||
|
|
@ -167,7 +170,8 @@ _cpp_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cpp_line_to (void *closure, cairo_point_t *point)
|
||||
_cpp_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cpp_t *cpp = closure;
|
||||
cairo_path_data_t *data = cpp->data;
|
||||
|
|
@ -193,10 +197,10 @@ _cpp_line_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cpp_curve_to (void *closure,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2,
|
||||
cairo_point_t *p3)
|
||||
_cpp_curve_to (void *closure,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2,
|
||||
const cairo_point_t *p3)
|
||||
{
|
||||
cpp_t *cpp = closure;
|
||||
cairo_path_data_t *data = cpp->data;
|
||||
|
|
|
|||
|
|
@ -329,7 +329,8 @@ typedef struct _pdf_path_info {
|
|||
} pdf_path_info_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_path_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_pdf_path_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
pdf_path_info_t *info = closure;
|
||||
double x = _cairo_fixed_to_double (point->x);
|
||||
|
|
@ -345,7 +346,8 @@ _cairo_pdf_path_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_path_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_pdf_path_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
pdf_path_info_t *info = closure;
|
||||
double x = _cairo_fixed_to_double (point->x);
|
||||
|
|
@ -369,9 +371,9 @@ _cairo_pdf_path_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_pdf_path_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
pdf_path_info_t *info = closure;
|
||||
double bx = _cairo_fixed_to_double (b->x);
|
||||
|
|
|
|||
|
|
@ -504,8 +504,8 @@ _cairo_pen_stroke_spline (cairo_pen_stroke_spline_t *stroker,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_pen_stroke_spline_add_point (void *closure,
|
||||
cairo_point_t *point)
|
||||
_cairo_pen_stroke_spline_add_point (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_pen_stroke_spline_t *stroker = closure;
|
||||
cairo_slope_t slope;
|
||||
|
|
|
|||
|
|
@ -289,7 +289,8 @@ typedef struct _quartz_stroke {
|
|||
|
||||
/* cairo path -> execute in context */
|
||||
static cairo_status_t
|
||||
_cairo_path_to_quartz_context_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_path_to_quartz_context_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
//ND((stderr, "moveto: %f %f\n", _cairo_fixed_to_double(point->x), _cairo_fixed_to_double(point->y)));
|
||||
quartz_stroke_t *stroke = (quartz_stroke_t *)closure;
|
||||
|
|
@ -304,7 +305,8 @@ _cairo_path_to_quartz_context_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_to_quartz_context_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_path_to_quartz_context_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
//ND((stderr, "lineto: %f %f\n", _cairo_fixed_to_double(point->x), _cairo_fixed_to_double(point->y)));
|
||||
quartz_stroke_t *stroke = (quartz_stroke_t *)closure;
|
||||
|
|
@ -322,7 +324,10 @@ _cairo_path_to_quartz_context_line_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_path_to_quartz_context_curve_to (void *closure, cairo_point_t *p0, cairo_point_t *p1, cairo_point_t *p2)
|
||||
_cairo_path_to_quartz_context_curve_to (void *closure,
|
||||
const cairo_point_t *p0,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
//ND( (stderr, "curveto: %f,%f %f,%f %f,%f\n",
|
||||
// _cairo_fixed_to_double(p0->x), _cairo_fixed_to_double(p0->y),
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ _cairo_box_intersects_line_segment (cairo_box_t *box, cairo_line_t *line)
|
|||
|
||||
cairo_fixed_t xlen, ylen;
|
||||
|
||||
if (_cairo_box_contains_point(box, &line->p1) ||
|
||||
_cairo_box_contains_point(box, &line->p2))
|
||||
if (_cairo_box_contains_point (box, &line->p1) ||
|
||||
_cairo_box_contains_point (box, &line->p2))
|
||||
return TRUE;
|
||||
|
||||
xlen = P2x - P1x;
|
||||
|
|
@ -216,7 +216,7 @@ _cairo_box_intersects_line_segment (cairo_box_t *box, cairo_line_t *line)
|
|||
}
|
||||
|
||||
cairo_bool_t
|
||||
_cairo_box_contains_point (cairo_box_t *box, cairo_point_t *point)
|
||||
_cairo_box_contains_point (cairo_box_t *box, const cairo_point_t *point)
|
||||
{
|
||||
if (point->x < box->p1.x || point->x > box->p2.x ||
|
||||
point->y < box->p1.y || point->y > box->p2.y)
|
||||
|
|
|
|||
|
|
@ -1973,7 +1973,8 @@ typedef struct _cairo_scaled_glyph_path_closure {
|
|||
} cairo_scaled_glyph_path_closure_t;
|
||||
|
||||
static cairo_status_t
|
||||
_scaled_glyph_path_move_to (void *abstract_closure, cairo_point_t *point)
|
||||
_scaled_glyph_path_move_to (void *abstract_closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
|
||||
|
||||
|
|
@ -1983,7 +1984,8 @@ _scaled_glyph_path_move_to (void *abstract_closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_scaled_glyph_path_line_to (void *abstract_closure, cairo_point_t *point)
|
||||
_scaled_glyph_path_line_to (void *abstract_closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
|
||||
|
||||
|
|
@ -1994,9 +1996,9 @@ _scaled_glyph_path_line_to (void *abstract_closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_scaled_glyph_path_curve_to (void *abstract_closure,
|
||||
cairo_point_t *p0,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2)
|
||||
const cairo_point_t *p0,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2)
|
||||
{
|
||||
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
|
||||
|
||||
|
|
|
|||
|
|
@ -1168,7 +1168,8 @@ _emit_source (cairo_script_surface_t *surface,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_path_move_to (void *closure, cairo_point_t *point)
|
||||
_path_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
_cairo_output_stream_printf (closure,
|
||||
" %f %f m",
|
||||
|
|
@ -1179,7 +1180,8 @@ _path_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_path_line_to (void *closure, cairo_point_t *point)
|
||||
_path_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
_cairo_output_stream_printf (closure,
|
||||
" %f %f l",
|
||||
|
|
@ -1191,9 +1193,9 @@ _path_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_path_curve_to (void *closure,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2,
|
||||
cairo_point_t *p3)
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2,
|
||||
const cairo_point_t *p3)
|
||||
{
|
||||
_cairo_output_stream_printf (closure,
|
||||
" %f %f %f %f %f %f c",
|
||||
|
|
|
|||
|
|
@ -33,9 +33,8 @@ typedef struct {
|
|||
} scan_converter_filler_t;
|
||||
|
||||
static void
|
||||
scan_converter_filler_init (
|
||||
scan_converter_filler_t *filler,
|
||||
cairo_scan_converter_t *converter)
|
||||
scan_converter_filler_init (scan_converter_filler_t *filler,
|
||||
cairo_scan_converter_t *converter)
|
||||
{
|
||||
filler->converter = converter;
|
||||
filler->current_point.x = 0;
|
||||
|
|
@ -44,9 +43,8 @@ scan_converter_filler_init (
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
scan_converter_filler_move_to (
|
||||
void *closure,
|
||||
cairo_point_t *p)
|
||||
scan_converter_filler_move_to (void *closure,
|
||||
const cairo_point_t *p)
|
||||
{
|
||||
scan_converter_filler_t *filler = closure;
|
||||
filler->current_point.x = p->x;
|
||||
|
|
@ -56,9 +54,8 @@ scan_converter_filler_move_to (
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
scan_converter_filler_line_to (
|
||||
void *closure,
|
||||
cairo_point_t *p)
|
||||
scan_converter_filler_line_to (void *closure,
|
||||
const cairo_point_t *p)
|
||||
{
|
||||
scan_converter_filler_t *filler = closure;
|
||||
cairo_status_t status;
|
||||
|
|
@ -78,8 +75,7 @@ scan_converter_filler_line_to (
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
scan_converter_filler_close_path (
|
||||
void *closure)
|
||||
scan_converter_filler_close_path (void *closure)
|
||||
{
|
||||
scan_converter_filler_t *filler = closure;
|
||||
cairo_status_t status;
|
||||
|
|
|
|||
|
|
@ -522,14 +522,14 @@ _cairo_svg_surface_emit_transform (cairo_output_stream_t *output,
|
|||
matrix.x0, matrix.y0);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
cairo_output_stream_t *output;
|
||||
cairo_matrix_t *ctm_inverse;
|
||||
} svg_path_info_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_svg_path_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_svg_path_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
svg_path_info_t *info = closure;
|
||||
double x = _cairo_fixed_to_double (point->x);
|
||||
|
|
@ -544,7 +544,8 @@ _cairo_svg_path_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_svg_path_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_svg_path_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
svg_path_info_t *info = closure;
|
||||
double x = _cairo_fixed_to_double (point->x);
|
||||
|
|
@ -560,9 +561,9 @@ _cairo_svg_path_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_svg_path_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
svg_path_info_t *info = closure;
|
||||
double bx = _cairo_fixed_to_double (b->x);
|
||||
|
|
|
|||
|
|
@ -218,8 +218,8 @@ typedef struct _ps_path_info {
|
|||
} t1_path_info_t;
|
||||
|
||||
static cairo_status_t
|
||||
_charstring_move_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
_charstring_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
t1_path_info_t *path_info = (t1_path_info_t *) closure;
|
||||
int dx, dy;
|
||||
|
|
@ -242,8 +242,8 @@ _charstring_move_to (void *closure,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_charstring_line_to (void *closure,
|
||||
cairo_point_t *point)
|
||||
_charstring_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
t1_path_info_t *path_info = (t1_path_info_t *) closure;
|
||||
int dx, dy;
|
||||
|
|
@ -266,10 +266,10 @@ _charstring_line_to (void *closure,
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_charstring_curve_to (void *closure,
|
||||
cairo_point_t *point1,
|
||||
cairo_point_t *point2,
|
||||
cairo_point_t *point3)
|
||||
_charstring_curve_to (void *closure,
|
||||
const cairo_point_t *point1,
|
||||
const cairo_point_t *point2,
|
||||
const cairo_point_t *point3)
|
||||
{
|
||||
t1_path_info_t *path_info = (t1_path_info_t *) closure;
|
||||
int dx1, dy1, dx2, dy2, dx3, dy3;
|
||||
|
|
|
|||
|
|
@ -306,7 +306,8 @@ typedef struct _cairo_polygon {
|
|||
} cairo_polygon_t;
|
||||
|
||||
typedef cairo_status_t
|
||||
(*cairo_spline_add_point_func_t) (void *closure, cairo_point_t *point);
|
||||
(*cairo_spline_add_point_func_t) (void *closure,
|
||||
const cairo_point_t *point);
|
||||
|
||||
typedef struct _cairo_spline_knots {
|
||||
cairo_point_t a, b, c, d;
|
||||
|
|
|
|||
|
|
@ -982,7 +982,8 @@ typedef struct _win32_print_path_info {
|
|||
} win32_path_info_t;
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_win32_printing_surface_path_move_to (void *closure, cairo_point_t *point)
|
||||
_cairo_win32_printing_surface_path_move_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
win32_path_info_t *path_info = closure;
|
||||
|
||||
|
|
@ -1004,7 +1005,8 @@ _cairo_win32_printing_surface_path_move_to (void *closure, cairo_point_t *point)
|
|||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_win32_printing_surface_path_line_to (void *closure, cairo_point_t *point)
|
||||
_cairo_win32_printing_surface_path_line_to (void *closure,
|
||||
const cairo_point_t *point)
|
||||
{
|
||||
win32_path_info_t *path_info = closure;
|
||||
|
||||
|
|
@ -1027,9 +1029,9 @@ _cairo_win32_printing_surface_path_line_to (void *closure, cairo_point_t *point)
|
|||
|
||||
static cairo_status_t
|
||||
_cairo_win32_printing_surface_path_curve_to (void *closure,
|
||||
cairo_point_t *b,
|
||||
cairo_point_t *c,
|
||||
cairo_point_t *d)
|
||||
const cairo_point_t *b,
|
||||
const cairo_point_t *c,
|
||||
const cairo_point_t *d)
|
||||
{
|
||||
win32_path_info_t *path_info = closure;
|
||||
POINT points[3];
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ cairo_private cairo_bool_t
|
|||
_cairo_box_intersects_line_segment (cairo_box_t *box, cairo_line_t *line);
|
||||
|
||||
cairo_private cairo_bool_t
|
||||
_cairo_box_contains_point (cairo_box_t *box, cairo_point_t *point);
|
||||
_cairo_box_contains_point (cairo_box_t *box, const cairo_point_t *point);
|
||||
|
||||
cairo_private void
|
||||
_cairo_composite_rectangles_init (cairo_composite_rectangles_t *rects,
|
||||
|
|
@ -1502,17 +1502,17 @@ _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path,
|
|||
|
||||
typedef cairo_status_t
|
||||
(cairo_path_fixed_move_to_func_t) (void *closure,
|
||||
cairo_point_t *point);
|
||||
const cairo_point_t *point);
|
||||
|
||||
typedef cairo_status_t
|
||||
(cairo_path_fixed_line_to_func_t) (void *closure,
|
||||
cairo_point_t *point);
|
||||
const cairo_point_t *point);
|
||||
|
||||
typedef cairo_status_t
|
||||
(cairo_path_fixed_curve_to_func_t) (void *closure,
|
||||
cairo_point_t *p0,
|
||||
cairo_point_t *p1,
|
||||
cairo_point_t *p2);
|
||||
const cairo_point_t *p0,
|
||||
const cairo_point_t *p1,
|
||||
const cairo_point_t *p2);
|
||||
|
||||
typedef cairo_status_t
|
||||
(cairo_path_fixed_close_path_func_t) (void *closure);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue