[Commit] cairo/src cairo.c, 1.19, 1.20 cairo_gstate.c, 1.18,
1.19 cairo_path.c, 1.7, 1.8 cairo_path_bounds.c, 1.6,
1.7 cairo_path_fill.c, 1.5, 1.6 cairo_path_stroke.c, 1.8,
1.9 cairo_pen.c, 1.8, 1.9 cairo_polygon.c, 1.2,
1.3 cairo_spline.c, 1.5, 1.6 cairo_xlib_surface.c, 1.1,
1.2 cairoint.h, 1.26, 1.27
Carl Worth
commit at keithp.com
Sat Oct 4 10:06:18 PDT 2003
Committed by: cworth
Update of /local/src/CVS/cairo/src
In directory home.keithp.com:/tmp/cvs-serv25690/src
Modified Files:
cairo.c cairo_gstate.c cairo_path.c cairo_path_bounds.c
cairo_path_fill.c cairo_path_stroke.c cairo_pen.c
cairo_polygon.c cairo_spline.c cairo_xlib_surface.c cairoint.h
Log Message:
Remove abbreviation of "point" as "pt".
Fix cairo_destrot, cairo_set_target_surface, and cairo_set_target_image to
act appropriately in the face of non-zero status.
Index: cairo.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cairo.c 1 Oct 2003 01:56:22 -0000 1.19
+++ cairo.c 4 Oct 2003 16:06:15 -0000 1.20
@@ -63,15 +63,15 @@
void
cairo_destroy (cairo_t *cr)
{
- if (cr->status)
- return;
-
cr->ref_count--;
if (cr->ref_count)
return;
while (cr->gstate) {
- cairo_restore (cr);
+ cairo_gstate_t *tmp = cr->gstate;
+ cr->gstate = tmp->next;
+
+ _cairo_gstate_destroy (tmp);
}
free (cr);
@@ -164,7 +164,7 @@
void
cairo_set_target_surface (cairo_t *cr, cairo_surface_t *surface)
{
- if (cr->status && cr->status != CAIRO_STATUS_NO_TARGET_SURFACE)
+ if (cr->status)
return;
cr->status = _cairo_gstate_set_target_surface (cr->gstate, surface);
@@ -181,7 +181,7 @@
{
cairo_surface_t *surface;
- if (cr->status && cr->status != CAIRO_STATUS_NO_TARGET_SURFACE)
+ if (cr->status)
return;
surface = cairo_surface_create_for_image (data,
@@ -769,7 +769,7 @@
return "no target surface has been set";
}
- return "";
+ return "<unknown error status>";
}
DEPRECATE (cairo_get_status_string, cairo_status_string);
Index: cairo_gstate.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_gstate.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cairo_gstate.c 2 Oct 2003 00:34:19 -0000 1.18
+++ cairo_gstate.c 4 Oct 2003 16:06:16 -0000 1.19
@@ -31,7 +31,7 @@
#include "cairoint.h"
static void
-_cairo_gstate_set_current_pt (cairo_gstate_t *gstate, double x, double y);
+_cairo_gstate_set_current_point (cairo_gstate_t *gstate, double x, double y);
static cairo_status_t
_cairo_gstate_ensure_source (cairo_gstate_t *gstate);
@@ -93,9 +93,9 @@
_cairo_path_init (&gstate->path);
- gstate->current_pt.x = 0.0;
- gstate->current_pt.y = 0.0;
- gstate->has_current_pt = 0;
+ gstate->current_point.x = 0.0;
+ gstate->current_point.y = 0.0;
+ gstate->has_current_point = 0;
_cairo_pen_init_empty (&gstate->pen_regular);
@@ -663,19 +663,19 @@
}
static void
-_cairo_gstate_set_current_pt (cairo_gstate_t *gstate, double x, double y)
+_cairo_gstate_set_current_point (cairo_gstate_t *gstate, double x, double y)
{
- gstate->current_pt.x = x;
- gstate->current_pt.y = y;
+ gstate->current_point.x = x;
+ gstate->current_point.y = y;
- gstate->has_current_pt = 1;
+ gstate->has_current_point = 1;
}
cairo_status_t
_cairo_gstate_new_path (cairo_gstate_t *gstate)
{
_cairo_path_fini (&gstate->path);
- gstate->has_current_pt = 0;
+ gstate->has_current_point = 0;
return CAIRO_STATUS_SUCCESS;
}
@@ -689,9 +689,9 @@
status = _cairo_path_move_to (&gstate->path, x, y);
- _cairo_gstate_set_current_pt (gstate, x, y);
+ _cairo_gstate_set_current_point (gstate, x, y);
- gstate->last_move_pt = gstate->current_pt;
+ gstate->last_move_point = gstate->current_point;
return status;
}
@@ -705,7 +705,7 @@
status = _cairo_path_line_to (&gstate->path, x, y);
- _cairo_gstate_set_current_pt (gstate, x, y);
+ _cairo_gstate_set_current_point (gstate, x, y);
return status;
}
@@ -727,7 +727,7 @@
x2, y2,
x3, y3);
- _cairo_gstate_set_current_pt (gstate, x3, y3);
+ _cairo_gstate_set_current_point (gstate, x3, y3);
return status;
}
@@ -1006,14 +1006,14 @@
cairo_matrix_transform_distance (&gstate->ctm, &dx, &dy);
- x = gstate->current_pt.x + dx;
- y = gstate->current_pt.y + dy;
+ x = gstate->current_point.x + dx;
+ y = gstate->current_point.y + dy;
status = _cairo_path_move_to (&gstate->path, x, y);
- _cairo_gstate_set_current_pt (gstate, x, y);
+ _cairo_gstate_set_current_point (gstate, x, y);
- gstate->last_move_pt = gstate->current_pt;
+ gstate->last_move_point = gstate->current_point;
return status;
}
@@ -1026,12 +1026,12 @@
cairo_matrix_transform_distance (&gstate->ctm, &dx, &dy);
- x = gstate->current_pt.x + dx;
- y = gstate->current_pt.y + dy;
+ x = gstate->current_point.x + dx;
+ y = gstate->current_point.y + dy;
status = _cairo_path_line_to (&gstate->path, x, y);
- _cairo_gstate_set_current_pt (gstate, x, y);
+ _cairo_gstate_set_current_point (gstate, x, y);
return status;
}
@@ -1049,13 +1049,13 @@
cairo_matrix_transform_distance (&gstate->ctm, &dx3, &dy3);
status = _cairo_path_curve_to (&gstate->path,
- gstate->current_pt.x + dx1, gstate->current_pt.y + dy1,
- gstate->current_pt.x + dx2, gstate->current_pt.y + dy2,
- gstate->current_pt.x + dx3, gstate->current_pt.y + dy3);
+ gstate->current_point.x + dx1, gstate->current_point.y + dy1,
+ gstate->current_point.x + dx2, gstate->current_point.y + dy2,
+ gstate->current_point.x + dx3, gstate->current_point.y + dy3);
- _cairo_gstate_set_current_pt (gstate,
- gstate->current_pt.x + dx3,
- gstate->current_pt.y + dy3);
+ _cairo_gstate_set_current_point (gstate,
+ gstate->current_point.x + dx3,
+ gstate->current_point.y + dy3);
return status;
}
@@ -1078,9 +1078,9 @@
status = _cairo_path_close_path (&gstate->path);
- _cairo_gstate_set_current_pt (gstate,
- gstate->last_move_pt.x,
- gstate->last_move_pt.y);
+ _cairo_gstate_set_current_point (gstate,
+ gstate->last_move_point.x,
+ gstate->last_move_point.y);
return status;
}
@@ -1090,9 +1090,9 @@
{
double x, y;
- if (gstate->has_current_pt) {
- x = gstate->current_pt.x;
- y = gstate->current_pt.y;
+ if (gstate->has_current_point) {
+ x = gstate->current_point.x;
+ y = gstate->current_point.y;
cairo_matrix_transform_point (&gstate->ctm_inverse, &x, &y);
} else {
x = 0.0;
@@ -1396,9 +1396,9 @@
/* XXX: I believe this is correct, but it would be much more clear
to have some explicit current_point accesor functions, (one for
user- and one for device-space). */
- if (gstate->has_current_pt) {
- x = gstate->current_pt.x;
- y = gstate->current_pt.y;
+ if (gstate->has_current_point) {
+ x = gstate->current_point.x;
+ y = gstate->current_point.y;
} else {
x = 0;
y = 0;
Index: cairo_path.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_path.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cairo_path.c 27 Sep 2003 12:00:47 -0000 1.7
+++ cairo_path.c 4 Oct 2003 16:06:16 -0000 1.8
@@ -30,7 +30,7 @@
/* private functions */
static cairo_status_t
-_cairo_path_add (cairo_path_t *path, cairo_path_op_t op, cairo_point_t *pts, int num_pts);
+_cairo_path_add (cairo_path_t *path, cairo_path_op_t op, cairo_point_t *points, int num_pts);
static void
_cairo_path_add_op_buf (cairo_path_t *path, cairo_path_op_buf_t *op);
@@ -60,7 +60,7 @@
_cairo_path_arg_buf_destroy (cairo_path_arg_buf_t *buf);
static void
-_cairo_path_arg_buf_add (cairo_path_arg_buf_t *arg, cairo_point_t *pts, int num_pts);
+_cairo_path_arg_buf_add (cairo_path_arg_buf_t *arg, cairo_point_t *points, int num_points);
void
_cairo_path_init (cairo_path_t *path)
@@ -125,23 +125,23 @@
cairo_status_t
_cairo_path_move_to (cairo_path_t *path, double x, double y)
{
- cairo_point_t pt;
+ cairo_point_t point;
- pt.x = XDoubleToFixed (x);
- pt.y = XDoubleToFixed (y);
+ point.x = XDoubleToFixed (x);
+ point.y = XDoubleToFixed (y);
- return _cairo_path_add (path, CAIRO_PATH_OP_MOVE_TO, &pt, 1);
+ return _cairo_path_add (path, CAIRO_PATH_OP_MOVE_TO, &point, 1);
}
cairo_status_t
_cairo_path_line_to (cairo_path_t *path, double x, double y)
{
- cairo_point_t pt;
+ cairo_point_t point;
- pt.x = XDoubleToFixed (x);
- pt.y = XDoubleToFixed (y);
+ point.x = XDoubleToFixed (x);
+ point.y = XDoubleToFixed (y);
- return _cairo_path_add (path, CAIRO_PATH_OP_LINE_TO, &pt, 1);
+ return _cairo_path_add (path, CAIRO_PATH_OP_LINE_TO, &point, 1);
}
cairo_status_t
@@ -150,18 +150,18 @@
double x2, double y2,
double x3, double y3)
{
- cairo_point_t pt[3];
+ cairo_point_t point[3];
- pt[0].x = XDoubleToFixed (x1);
- pt[0].y = XDoubleToFixed (y1);
+ point[0].x = XDoubleToFixed (x1);
+ point[0].y = XDoubleToFixed (y1);
- pt[1].x = XDoubleToFixed (x2);
- pt[1].y = XDoubleToFixed (y2);
+ point[1].x = XDoubleToFixed (x2);
+ point[1].y = XDoubleToFixed (y2);
- pt[2].x = XDoubleToFixed (x3);
- pt[2].y = XDoubleToFixed (y3);
+ point[2].x = XDoubleToFixed (x3);
+ point[2].y = XDoubleToFixed (y3);
- return _cairo_path_add (path, CAIRO_PATH_OP_CURVE_TO, pt, 3);
+ return _cairo_path_add (path, CAIRO_PATH_OP_CURVE_TO, point, 3);
}
cairo_status_t
@@ -171,7 +171,7 @@
}
static cairo_status_t
-_cairo_path_add (cairo_path_t *path, cairo_path_op_t op, cairo_point_t *pts, int num_pts)
+_cairo_path_add (cairo_path_t *path, cairo_path_op_t op, cairo_point_t *points, int num_points)
{
cairo_status_t status;
@@ -182,12 +182,12 @@
}
_cairo_path_op_buf_add (path->op_tail, op);
- if (path->arg_tail == NULL || path->arg_tail->num_pts + num_pts > CAIRO_PATH_BUF_SZ) {
+ if (path->arg_tail == NULL || path->arg_tail->num_points + num_points > CAIRO_PATH_BUF_SZ) {
status = _cairo_path_new_arg_buf (path);
if (status)
return status;
}
- _cairo_path_arg_buf_add (path->arg_tail, pts, num_pts);
+ _cairo_path_arg_buf_add (path->arg_tail, points, num_points);
return CAIRO_STATUS_SUCCESS;
}
@@ -286,7 +286,7 @@
arg = malloc (sizeof (cairo_path_arg_buf_t));
if (arg) {
- arg->num_pts = 0;
+ arg->num_points = 0;
arg->next = NULL;
}
@@ -300,12 +300,12 @@
}
static void
-_cairo_path_arg_buf_add (cairo_path_arg_buf_t *arg, cairo_point_t *pts, int num_pts)
+_cairo_path_arg_buf_add (cairo_path_arg_buf_t *arg, cairo_point_t *points, int num_points)
{
int i;
- for (i=0; i < num_pts; i++) {
- arg->pt[arg->num_pts++] = pts[i];
+ for (i=0; i < num_points; i++) {
+ arg->points[arg->num_points++] = points[i];
}
}
@@ -328,7 +328,7 @@
cairo_path_op_t op;
cairo_path_arg_buf_t *arg_buf = path->arg_head;
int buf_i = 0;
- cairo_point_t pt[CAIRO_PATH_OP_MAX_ARGS];
+ cairo_point_t point[CAIRO_PATH_OP_MAX_ARGS];
cairo_point_t current = {0, 0};
cairo_point_t first = {0, 0};
int has_current = 0;
@@ -354,15 +354,15 @@
if (dir == CAIRO_DIRECTION_REVERSE) {
if (buf_i == 0) {
arg_buf = arg_buf->prev;
- buf_i = arg_buf->num_pts;
+ buf_i = arg_buf->num_points;
}
buf_i -= num_args[op];
}
for (arg = 0; arg < num_args[op]; arg++) {
- pt[arg] = arg_buf->pt[buf_i];
+ point[arg] = arg_buf->points[buf_i];
buf_i++;
- if (buf_i >= arg_buf->num_pts) {
+ if (buf_i >= arg_buf->num_points) {
arg_buf = arg_buf->next;
buf_i = 0;
}
@@ -379,35 +379,35 @@
if (status)
return status;
}
- first = pt[0];
- current = pt[0];
+ first = point[0];
+ current = point[0];
has_current = 1;
has_edge = 0;
break;
case CAIRO_PATH_OP_LINE_TO:
if (has_current) {
- status = (*cb->add_edge) (closure, ¤t, &pt[0]);
+ status = (*cb->add_edge) (closure, ¤t, &point[0]);
if (status)
return status;
- current = pt[0];
+ current = point[0];
has_edge = 1;
} else {
- first = pt[0];
- current = pt[0];
+ first = point[0];
+ current = point[0];
has_current = 1;
has_edge = 0;
}
break;
case CAIRO_PATH_OP_CURVE_TO:
if (has_current) {
- status = (*cb->add_spline) (closure, ¤t, &pt[0], &pt[1], &pt[2]);
+ status = (*cb->add_spline) (closure, ¤t, &point[0], &point[1], &point[2]);
if (status)
return status;
- current = pt[2];
+ current = point[2];
has_edge = 1;
} else {
- first = pt[2];
- current = pt[2];
+ first = point[2];
+ current = point[2];
has_current = 1;
has_edge = 0;
}
Index: cairo_path_bounds.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_path_bounds.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo_path_bounds.c 27 Sep 2003 12:00:47 -0000 1.6
+++ cairo_path_bounds.c 4 Oct 2003 16:06:16 -0000 1.7
@@ -28,7 +28,7 @@
#include "cairoint.h"
typedef struct cairo_path_bounder {
- int has_pt;
+ int has_point;
cairo_fixed_t min_x;
cairo_fixed_t min_y;
@@ -43,7 +43,7 @@
_cairo_path_bounder_fini (cairo_path_bounder_t *bounder);
static cairo_status_t
-_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *pt);
+_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point);
static cairo_status_t
_cairo_path_bounder_add_edge (void *closure, cairo_point_t *p1, cairo_point_t *p2);
@@ -62,37 +62,37 @@
static void
_cairo_path_bounder_init (cairo_path_bounder_t *bounder)
{
- bounder->has_pt = 0;
+ bounder->has_point = 0;
}
static void
_cairo_path_bounder_fini (cairo_path_bounder_t *bounder)
{
- bounder->has_pt = 0;
+ bounder->has_point = 0;
}
static cairo_status_t
-_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *pt)
+_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point)
{
- if (bounder->has_pt) {
- if (pt->x < bounder->min_x)
- bounder->min_x = pt->x;
+ if (bounder->has_point) {
+ if (point->x < bounder->min_x)
+ bounder->min_x = point->x;
- if (pt->y < bounder->min_y)
- bounder->min_y = pt->y;
+ if (point->y < bounder->min_y)
+ bounder->min_y = point->y;
- if (pt->x > bounder->max_x)
- bounder->max_x = pt->x;
+ if (point->x > bounder->max_x)
+ bounder->max_x = point->x;
- if (pt->y > bounder->max_y)
- bounder->max_y = pt->y;
+ if (point->y > bounder->max_y)
+ bounder->max_y = point->y;
} else {
- bounder->min_x = pt->x;
- bounder->min_y = pt->y;
- bounder->max_x = pt->x;
- bounder->max_y = pt->y;
+ bounder->min_x = point->x;
+ bounder->min_y = point->y;
+ bounder->max_x = point->x;
+ bounder->max_y = point->y;
- bounder->has_pt = 1;
+ bounder->has_point = 1;
}
return CAIRO_STATUS_SUCCESS;
Index: cairo_path_fill.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_path_fill.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo_path_fill.c 27 Sep 2003 12:00:47 -0000 1.5
+++ cairo_path_fill.c 4 Oct 2003 16:06:16 -0000 1.6
@@ -98,8 +98,8 @@
if (status)
goto CLEANUP_SPLINE;
- for (i = 0; i < spline.num_pts - 1; i++) {
- status = _cairo_polygon_add_edge (polygon, &spline.pts[i], &spline.pts[i+1]);
+ for (i = 0; i < spline.num_points - 1; i++) {
+ status = _cairo_polygon_add_edge (polygon, &spline.points[i], &spline.points[i+1]);
if (status)
goto CLEANUP_SPLINE;
}
Index: cairo_path_stroke.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_path_stroke.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cairo_path_stroke.c 27 Sep 2003 12:00:47 -0000 1.8
+++ cairo_path_stroke.c 4 Oct 2003 16:06:16 -0000 1.9
@@ -66,7 +66,7 @@
_cairo_stroker_done_path (void *closure);
static void
-_translate_point (cairo_point_t *pt, cairo_point_t *offset);
+_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);
@@ -127,10 +127,10 @@
}
static void
-_translate_point (cairo_point_t *pt, cairo_point_t *offset)
+_translate_point (cairo_point_t *point, cairo_point_t *offset)
{
- pt->x += offset->x;
- pt->y += offset->y;
+ point->x += offset->x;
+ point->y += offset->y;
}
static int
@@ -138,8 +138,8 @@
{
cairo_slope_t in_slope, out_slope;
- _cairo_slope_init (&in_slope, &in->pt, &in->cw);
- _cairo_slope_init (&out_slope, &out->pt, &out->cw);
+ _cairo_slope_init (&in_slope, &in->point, &in->cw);
+ _cairo_slope_init (&out_slope, &out->point, &out->cw);
return _cairo_slope_clockwise (&in_slope, &out_slope);
}
@@ -174,7 +174,7 @@
cairo_point_t tri[3];
cairo_pen_t *pen = &gstate->pen_regular;
- tri[0] = in->pt;
+ tri[0] = in->point;
if (clockwise) {
_cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start);
step = -1;
@@ -188,8 +188,8 @@
i = start;
tri[1] = *inpt;
while (i != stop) {
- tri[2] = in->pt;
- _translate_point (&tri[2], &pen->vertex[i].pt);
+ tri[2] = in->point;
+ _translate_point (&tri[2], &pen->vertex[i].point);
_cairo_traps_tessellate_triangle (stroker->traps, tri);
tri[1] = tri[2];
i += step;
@@ -286,10 +286,10 @@
outer.x = _cairo_fixed_from_double (mx);
outer.y = _cairo_fixed_from_double (my);
_cairo_polygon_init (&polygon);
- _cairo_polygon_add_edge (&polygon, &in->pt, inpt);
+ _cairo_polygon_add_edge (&polygon, &in->point, inpt);
_cairo_polygon_add_edge (&polygon, inpt, &outer);
_cairo_polygon_add_edge (&polygon, &outer, outpt);
- _cairo_polygon_add_edge (&polygon, outpt, &in->pt);
+ _cairo_polygon_add_edge (&polygon, outpt, &in->point);
status = _cairo_traps_tessellate_polygon (stroker->traps,
&polygon,
CAIRO_FILL_RULE_WINDING);
@@ -301,7 +301,7 @@
}
case CAIRO_LINE_JOIN_BEVEL: {
cairo_point_t tri[3];
- tri[0] = in->pt;
+ tri[0] = in->point;
tri[1] = *inpt;
tri[2] = *outpt;
@@ -333,11 +333,11 @@
slope.dy = -slope.dy;
_cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop);
- tri[0] = f->pt;
+ tri[0] = f->point;
tri[1] = f->cw;
for (i=start; i != stop; i = (i+1) % pen->num_vertices) {
- tri[2] = f->pt;
- _translate_point (&tri[2], &pen->vertex[i].pt);
+ tri[2] = f->point;
+ _translate_point (&tri[2], &pen->vertex[i].point);
_cairo_traps_tessellate_triangle (stroker->traps, tri);
tri[1] = tri[2];
}
@@ -382,7 +382,7 @@
}
static void
-_compute_face (cairo_point_t *pt, cairo_slope_t *slope, cairo_gstate_t *gstate, cairo_stroke_face_t *face)
+_compute_face (cairo_point_t *point, cairo_slope_t *slope, cairo_gstate_t *gstate, cairo_stroke_face_t *face)
{
double mag, det;
double line_dx, line_dy;
@@ -436,12 +436,12 @@
offset_cw.x = -offset_ccw.x;
offset_cw.y = -offset_ccw.y;
- face->ccw = *pt;
+ face->ccw = *point;
_translate_point (&face->ccw, &offset_ccw);
- face->pt = *pt;
+ face->point = *point;
- face->cw = *pt;
+ face->cw = *point;
_translate_point (&face->cw, &offset_cw);
face->usr_vector.x = usr_vector.x;
@@ -665,17 +665,17 @@
stroker->is_first = 0;
extra_points[0] = start.cw;
- extra_points[0].x -= start.pt.x;
- extra_points[0].y -= start.pt.y;
+ extra_points[0].x -= start.point.x;
+ extra_points[0].y -= start.point.y;
extra_points[1] = start.ccw;
- extra_points[1].x -= start.pt.x;
- extra_points[1].y -= start.pt.y;
+ extra_points[1].x -= start.point.x;
+ extra_points[1].y -= start.point.y;
extra_points[2] = end.cw;
- extra_points[2].x -= end.pt.x;
- extra_points[2].y -= end.pt.y;
+ extra_points[2].x -= end.point.x;
+ extra_points[2].y -= end.point.y;
extra_points[3] = end.ccw;
- extra_points[3].x -= end.pt.x;
- extra_points[3].y -= end.pt.y;
+ extra_points[3].x -= end.point.x;
+ extra_points[3].y -= end.point.y;
status = _cairo_pen_add_points (&pen, extra_points, 4);
if (status)
Index: cairo_pen.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_pen.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cairo_pen.c 27 Sep 2003 12:00:47 -0000 1.8
+++ cairo_pen.c 4 Oct 2003 16:06:16 -0000 1.9
@@ -105,8 +105,8 @@
double dy = radius * sin (reflect ? -theta : theta);
cairo_pen_vertex_t *v = &pen->vertex[i];
cairo_matrix_transform_distance (&gstate->ctm, &dx, &dy);
- v->pt.x = _cairo_fixed_from_double (dx);
- v->pt.y = _cairo_fixed_from_double (dy);
+ v->point.x = _cairo_fixed_from_double (dx);
+ v->point.y = _cairo_fixed_from_double (dy);
}
_cairo_pen_compute_slopes (pen);
@@ -138,23 +138,23 @@
}
cairo_status_t
-_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *pt, int num_pts)
+_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points)
{
int i;
cairo_pen_vertex_t *v, *v_next, *new_vertex;
- pen->num_vertices += num_pts;
+ pen->num_vertices += num_points;
new_vertex = realloc (pen->vertex, pen->num_vertices * sizeof (cairo_pen_vertex_t));
if (new_vertex == NULL) {
- pen->num_vertices -= num_pts;
+ pen->num_vertices -= num_points;
return CAIRO_STATUS_NO_MEMORY;
}
pen->vertex = new_vertex;
/* initialize new vertices */
- for (i=0; i < num_pts; i++) {
+ for (i=0; i < num_points; i++) {
v = &pen->vertex[pen->num_vertices-(i+1)];
- v->pt = pt[i];
+ v->point = point[i];
}
qsort (pen->vertex, pen->num_vertices, sizeof (cairo_pen_vertex_t), _pen_vertex_compare);
@@ -203,8 +203,8 @@
v = &pen->vertex[i];
next = &pen->vertex[(i + 1) % pen->num_vertices];
- _cairo_slope_init (&v->slope_cw, &prev->pt, &v->pt);
- _cairo_slope_init (&v->slope_ccw, &v->pt, &next->pt);
+ _cairo_slope_init (&v->slope_cw, &prev->point, &v->point);
+ _cairo_slope_init (&v->slope_ccw, &v->point, &next->point);
}
}
@@ -222,22 +222,22 @@
const cairo_pen_vertex_t *b = bv;
cairo_fixed_48_16_t diff;
- int a_above = a->pt.y >= 0;
- int b_above = b->pt.y >= 0;
+ int a_above = a->point.y >= 0;
+ int b_above = b->point.y >= 0;
if (a_above != b_above)
return b_above - a_above;
- if (a->pt.y == 0 && b->pt.y == 0) {
- int a_right = a->pt.x >= 0;
- int b_right = b->pt.x >= 0;
+ if (a->point.y == 0 && b->point.y == 0) {
+ int a_right = a->point.x >= 0;
+ int b_right = b->point.x >= 0;
if (a_right != b_right)
return b_right - a_right;
}
- diff = ((cairo_fixed_48_16_t) a->pt.y * (cairo_fixed_48_16_t) b->pt.x
- - (cairo_fixed_48_16_t) b->pt.y * (cairo_fixed_48_16_t) a->pt.x);
+ diff = ((cairo_fixed_48_16_t) a->point.y * (cairo_fixed_48_16_t) b->point.x
+ - (cairo_fixed_48_16_t) b->point.y * (cairo_fixed_48_16_t) a->point.x);
if (diff > 0)
return 1;
@@ -312,19 +312,19 @@
cairo_status_t status;
int start, stop, step;
int active = 0;
- cairo_point_t hull_pt;
+ cairo_point_t hull_point;
cairo_slope_t slope, initial_slope, final_slope;
- cairo_point_t *pt = spline->pts;
- int num_pts = spline->num_pts;
+ cairo_point_t *point = spline->points;
+ int num_points = spline->num_points;
if (dir == CAIRO_DIRECTION_FORWARD) {
start = 0;
- stop = num_pts;
+ stop = num_points;
step = 1;
initial_slope = spline->initial_slope;
final_slope = spline->final_slope;
} else {
- start = num_pts - 1;
+ start = num_points - 1;
stop = -1;
step = -1;
initial_slope = spline->final_slope;
@@ -339,16 +339,16 @@
i = start;
while (i != stop) {
- hull_pt.x = pt[i].x + pen->vertex[active].pt.x;
- hull_pt.y = pt[i].y + pen->vertex[active].pt.y;
- status = _cairo_polygon_add_point (polygon, &hull_pt);
+ hull_point.x = point[i].x + pen->vertex[active].point.x;
+ hull_point.y = point[i].y + pen->vertex[active].point.y;
+ status = _cairo_polygon_add_point (polygon, &hull_point);
if (status)
return status;
if (i + step == stop)
slope = final_slope;
else
- _cairo_slope_init (&slope, &pt[i], &pt[i+step]);
+ _cairo_slope_init (&slope, &point[i], &point[i+step]);
if (_cairo_slope_counter_clockwise (&slope, &pen->vertex[active].slope_ccw)) {
if (++active == pen->num_vertices)
active = 0;
Index: cairo_polygon.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_polygon.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_polygon.c 30 Jul 2003 15:30:51 -0000 1.2
+++ cairo_polygon.c 4 Oct 2003 16:06:16 -0000 1.3
@@ -36,7 +36,7 @@
_cairo_polygon_grow_by (cairo_polygon_t *polygon, int additional);
static void
-_cairo_polygon_set_last_point (cairo_polygon_t *polygon, cairo_point_t *pt);
+_cairo_polygon_set_last_point (cairo_polygon_t *polygon, cairo_point_t *point);
void
_cairo_polygon_init (cairo_polygon_t *polygon)
@@ -46,8 +46,8 @@
polygon->edges_size = 0;
polygon->edges = NULL;
- polygon->first_pt_defined = 0;
- polygon->last_pt_defined = 0;
+ polygon->first_point_defined = 0;
+ polygon->last_point_defined = 0;
polygon->closed = 0;
}
@@ -62,8 +62,8 @@
polygon->num_edges = 0;
}
- polygon->first_pt_defined = 0;
- polygon->last_pt_defined = 0;
+ polygon->first_point_defined = 0;
+ polygon->last_point_defined = 0;
polygon->closed = 0;
}
@@ -93,10 +93,10 @@
}
static void
-_cairo_polygon_set_last_point (cairo_polygon_t *polygon, cairo_point_t *pt)
+_cairo_polygon_set_last_point (cairo_polygon_t *polygon, cairo_point_t *point)
{
- polygon->last_pt = *pt;
- polygon->last_pt_defined = 1;
+ polygon->last_point = *point;
+ polygon->last_point_defined = 1;
}
cairo_status_t
@@ -105,9 +105,9 @@
cairo_status_t status;
cairo_edge_t *edge;
- if (! polygon->first_pt_defined) {
- polygon->first_pt = *p1;
- polygon->first_pt_defined = 1;
+ if (! polygon->first_point_defined) {
+ polygon->first_point = *p1;
+ polygon->first_point_defined = 1;
polygon->closed = 0;
}
@@ -143,14 +143,14 @@
}
cairo_status_t
-_cairo_polygon_add_point (cairo_polygon_t *polygon, cairo_point_t *pt)
+_cairo_polygon_add_point (cairo_polygon_t *polygon, cairo_point_t *point)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
- if (polygon->last_pt_defined) {
- status = _cairo_polygon_add_edge (polygon, &polygon->last_pt, pt);
+ if (polygon->last_point_defined) {
+ status = _cairo_polygon_add_edge (polygon, &polygon->last_point, point);
} else {
- _cairo_polygon_set_last_point (polygon, pt);
+ _cairo_polygon_set_last_point (polygon, point);
}
return status;
@@ -161,13 +161,13 @@
{
cairo_status_t status;
- if (polygon->closed == 0 && polygon->last_pt_defined) {
- status = _cairo_polygon_add_edge (polygon, &polygon->last_pt, &polygon->first_pt);
+ if (polygon->closed == 0 && polygon->last_point_defined) {
+ status = _cairo_polygon_add_edge (polygon, &polygon->last_point, &polygon->first_point);
if (status)
return status;
polygon->closed = 1;
- polygon->first_pt_defined = 0;
+ polygon->first_point_defined = 0;
}
return CAIRO_STATUS_SUCCESS;
Index: cairo_spline.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_spline.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo_spline.c 27 Sep 2003 12:00:47 -0000 1.5
+++ cairo_spline.c 4 Oct 2003 16:06:16 -0000 1.6
@@ -31,7 +31,7 @@
_cairo_spline_grow_by (cairo_spline_t *spline, int additional);
static cairo_status_t
-_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *pt);
+_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *point);
static void
_lerp_half (cairo_point_t *a, cairo_point_t *b, cairo_point_t *result);
@@ -75,9 +75,9 @@
_cairo_slope_init (&spline->final_slope, &spline->a, &spline->d);
}
- spline->num_pts = 0;
- spline->pts_size = 0;
- spline->pts = NULL;
+ spline->num_points = 0;
+ spline->points_size = 0;
+ spline->points = NULL;
return CAIRO_STATUS_SUCCESS;
}
@@ -85,48 +85,48 @@
void
_cairo_spline_fini (cairo_spline_t *spline)
{
- spline->num_pts = 0;
- spline->pts_size = 0;
- free (spline->pts);
- spline->pts = NULL;
+ spline->num_points = 0;
+ spline->points_size = 0;
+ free (spline->points);
+ spline->points = NULL;
}
static cairo_status_t
_cairo_spline_grow_by (cairo_spline_t *spline, int additional)
{
- cairo_point_t *new_pts;
- int old_size = spline->pts_size;
- int new_size = spline->num_pts + additional;
+ cairo_point_t *new_points;
+ int old_size = spline->points_size;
+ int new_size = spline->num_points + additional;
- if (new_size <= spline->pts_size)
+ if (new_size <= spline->points_size)
return CAIRO_STATUS_SUCCESS;
- spline->pts_size = new_size;
- new_pts = realloc (spline->pts, spline->pts_size * sizeof (cairo_point_t));
+ spline->points_size = new_size;
+ new_points = realloc (spline->points, spline->points_size * sizeof (cairo_point_t));
- if (new_pts == NULL) {
- spline->pts_size = old_size;
+ if (new_points == NULL) {
+ spline->points_size = old_size;
return CAIRO_STATUS_NO_MEMORY;
}
- spline->pts = new_pts;
+ spline->points = new_points;
return CAIRO_STATUS_SUCCESS;
}
static cairo_status_t
-_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *pt)
+_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *point)
{
cairo_status_t status;
- if (spline->num_pts >= spline->pts_size) {
+ if (spline->num_points >= spline->points_size) {
status = _cairo_spline_grow_by (spline, CAIRO_SPLINE_GROWTH_INC);
if (status)
return status;
}
- spline->pts[spline->num_pts] = *pt;
- spline->num_pts++;
+ spline->points[spline->num_points] = *point;
+ spline->num_points++;
return CAIRO_STATUS_SUCCESS;
}
@@ -256,7 +256,7 @@
{
cairo_status_t status;
- if (spline->pts_size) {
+ if (spline->points_size) {
_cairo_spline_fini (spline);
}
Index: cairo_xlib_surface.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_xlib_surface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo_xlib_surface.c 1 Oct 2003 01:56:22 -0000 1.1
+++ cairo_xlib_surface.c 4 Oct 2003 16:06:16 -0000 1.2
@@ -469,7 +469,7 @@
composite_trapezoids: (void *) _cairo_xlib_surface_composite_trapezoids,
};
-Picture
+static Picture
_cairo_xlib_surface_get_picture (cairo_surface_t *surface)
{
if (surface->backend != &cairo_xlib_surface_backend)
Index: cairoint.h
===================================================================
RCS file: /local/src/CVS/cairo/src/cairoint.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cairoint.h 2 Oct 2003 00:34:20 -0000 1.26
+++ cairoint.h 4 Oct 2003 16:06:16 -0000 1.27
@@ -166,8 +166,8 @@
} cairo_path_op_buf_t;
typedef struct cairo_path_arg_buf {
- int num_pts;
- cairo_point_t pt[CAIRO_PATH_BUF_SZ];
+ int num_points;
+ cairo_point_t points[CAIRO_PATH_BUF_SZ];
struct cairo_path_arg_buf *next, *prev;
} cairo_path_arg_buf_t;
@@ -192,10 +192,10 @@
int edges_size;
cairo_edge_t *edges;
- cairo_point_t first_pt;
- int first_pt_defined;
- cairo_point_t last_pt;
- int last_pt_defined;
+ cairo_point_t first_point;
+ int first_point_defined;
+ cairo_point_t last_point;
+ int last_point_defined;
int closed;
} cairo_polygon_t;
@@ -206,13 +206,13 @@
cairo_slope_t initial_slope;
cairo_slope_t final_slope;
- int num_pts;
- int pts_size;
- cairo_point_t *pts;
+ int num_points;
+ int points_size;
+ cairo_point_t *points;
} cairo_spline_t;
typedef struct _cairo_pen_vertex {
- cairo_point_t pt;
+ cairo_point_t point;
cairo_slope_t slope_ccw;
cairo_slope_t slope_cw;
@@ -394,9 +394,9 @@
cairo_path_t path;
- cairo_point_double_t last_move_pt;
- cairo_point_double_t current_pt;
- int has_current_pt;
+ cairo_point_double_t last_move_point;
+ cairo_point_double_t current_point;
+ int has_current_point;
cairo_pen_t pen_regular;
@@ -411,7 +411,7 @@
typedef struct cairo_stroke_face {
cairo_point_t ccw;
- cairo_point_t pt;
+ cairo_point_t point;
cairo_point_t cw;
cairo_slope_t dev_vector;
cairo_point_double_t usr_vector;
@@ -421,10 +421,10 @@
extern cairo_fixed_t __internal_linkage
_cairo_fixed_from_int (int i);
-extern cairo_fixed_t __internal_linkage
+extern cairo_fixed_t
_cairo_fixed_from_double (double d);
-extern double __internal_linkage
+extern double
_cairo_fixed_to_double (cairo_fixed_t f);
/* cairo_gstate.c */
@@ -824,7 +824,7 @@
_cairo_pen_fini (cairo_pen_t *pen);
extern cairo_status_t __internal_linkage
-_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *pt, int num_pts);
+_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points);
extern cairo_status_t __internal_linkage
_cairo_pen_add_points_for_slopes (cairo_pen_t *pen,
@@ -860,7 +860,7 @@
_cairo_polygon_add_edge (cairo_polygon_t *polygon, cairo_point_t *p1, cairo_point_t *p2);
extern cairo_status_t __internal_linkage
-_cairo_polygon_add_point (cairo_polygon_t *polygon, cairo_point_t *pt);
+_cairo_polygon_add_point (cairo_polygon_t *polygon, cairo_point_t *point);
extern cairo_status_t __internal_linkage
_cairo_polygon_close (cairo_polygon_t *polygon);
@@ -932,6 +932,9 @@
_cairo_slope_init (cairo_slope_t *slope, cairo_point_t *a, cairo_point_t *b);
extern int __internal_linkage
+_cairo_slope_compare (cairo_slope_t *a, cairo_slope_t *b);
+
+extern int __internal_linkage
_cairo_slope_clockwise (cairo_slope_t *a, cairo_slope_t *b);
extern int __internal_linkage
More information about the Commit
mailing list