summaryrefslogtreecommitdiff
path: root/src/cairo-path-bounds.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2004-02-12 19:02:33 +0000
committerCarl Worth <cworth@cworth.org>2004-02-12 19:02:33 +0000
commitb55f1076793229d182463100ed9de2a68dd3c77b (patch)
treeba55f8191450559c189b0f31e482144cd0a5d55c /src/cairo-path-bounds.c
parent810037bc7c7707337fb1e7682b36651f6a7c4e04 (diff)
Add typedefs for new callbacks to be used by cairo_current_path: cairo_move_to_func, cairo_line_to_func, cairo_curve_to_func, and cairo_close_path_func.
cairo_path.last_move_point and cairo_path.current_point are now fixed-point not doubles for consistency. Now accept 4 explicit function pointers rather than a structure. Eliminate unnecessary done_path callback. Track change in _cairo_path_interpret. Code previously in done_path callback is now here immediately after call to _cairo_path_interpret. Internal _cairo_path API modified to accept fixed-point data everywhere. Much cleaner this way. Have to convert doubles to fixed-point to track changes in _cairo_path API. Keep data in fixed-point rather than going through intermediate doubles. Track changes in _cairo_path API. New function to help when working with freetype.
Diffstat (limited to 'src/cairo-path-bounds.c')
-rw-r--r--src/cairo-path-bounds.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index ce0d8391..6a02b9ac 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -60,9 +60,6 @@ _cairo_path_bounder_curve_to (void *closure,
static cairo_status_t
_cairo_path_bounder_close_path (void *closure);
-static cairo_status_t
-_cairo_path_bounder_done_path (void *closure);
-
static void
_cairo_path_bounder_init (cairo_path_bounder_t *bounder)
{
@@ -143,30 +140,22 @@ _cairo_path_bounder_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
-_cairo_path_bounder_done_path (void *closure)
-{
- return CAIRO_STATUS_SUCCESS;
-}
-
/* XXX: Perhaps this should compute a PixRegion rather than 4 doubles */
cairo_status_t
_cairo_path_bounds (cairo_path_t *path, double *x1, double *y1, double *x2, double *y2)
{
cairo_status_t status;
- static cairo_path_callbacks_t const cb = {
- _cairo_path_bounder_move_to,
- _cairo_path_bounder_line_to,
- _cairo_path_bounder_curve_to,
- _cairo_path_bounder_close_path,
- _cairo_path_bounder_done_path
- };
cairo_path_bounder_t bounder;
_cairo_path_bounder_init (&bounder);
- status = _cairo_path_interpret (path, CAIRO_DIRECTION_FORWARD, &cb, &bounder);
+ status = _cairo_path_interpret (path, CAIRO_DIRECTION_FORWARD,
+ _cairo_path_bounder_move_to,
+ _cairo_path_bounder_line_to,
+ _cairo_path_bounder_curve_to,
+ _cairo_path_bounder_close_path,
+ &bounder);
if (status) {
*x1 = *y1 = *x2 = *y2 = 0.0;
_cairo_path_bounder_fini (&bounder);