[cairo-commit] 5 commits - src/cairo-analysis-surface.c src/cairo.c src/cairo-font-face-twin.c src/cairo-gstate.c src/cairoint.h src/cairo-path-bounds.c src/cairo-scaled-font.c src/cairo-spline.c src/cairo-surface-fallback.c src/cairo-types-private.h test/Makefile.am test/spline-decomposition.c test/spline-decomposition.pdf.ref.png test/spline-decomposition.ps2.ref.png test/spline-decomposition.ps3.ref.png test/spline-decomposition.ps.ref.png test/spline-decomposition.ref.png test/spline-decomposition.svg11.ref.png test/spline-decomposition.svg12.ref.png test/spline-decomposition.svg.ref.png test/twin.c test/twin.pdf.ref.png test/twin.ps2.ref.png test/twin.ps3.ref.png test/twin.ps.ref.png test/twin.ref.png test/twin.svg11.argb32.ref.png test/twin.svg11.ref.png test/twin.svg11.rgb24.ref.png test/twin.svg12.argb32.ref.png test/twin.svg12.ref.png test/twin.svg12.rgb24.ref.png test/twin.svg.ref.png

Chris Wilson ickle at kemper.freedesktop.org
Mon Dec 29 08:13:34 PST 2008


 dev/null                              |binary
 src/cairo-analysis-surface.c          |    3 -
 src/cairo-font-face-twin.c            |    6 ++-
 src/cairo-gstate.c                    |    3 -
 src/cairo-path-bounds.c               |   24 ++++--------
 src/cairo-scaled-font.c               |    2 +
 src/cairo-spline.c                    |   15 +++++---
 src/cairo-surface-fallback.c          |    1 
 src/cairo-types-private.h             |    2 -
 src/cairo.c                           |    4 ++
 src/cairoint.h                        |   13 ++++---
 test/Makefile.am                      |   12 ++----
 test/spline-decomposition.c           |   63 ++++++++++++++++++++++++++++++++++
 test/spline-decomposition.pdf.ref.png |binary
 test/spline-decomposition.ps.ref.png  |binary
 test/spline-decomposition.ref.png     |binary
 test/spline-decomposition.svg.ref.png |binary
 test/twin.c                           |    2 -
 test/twin.ps.ref.png                  |binary
 test/twin.ref.png                     |binary
 test/twin.svg.ref.png                 |binary
 21 files changed, 108 insertions(+), 42 deletions(-)

New commits:
commit fa63c43532de4a38d59d2746c34c815d18121062
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 29 16:11:29 2008 +0000

    [spline] Be pedantic and propagate errors.
    
    We know that the current users will always return SUCCESS, but propagate
    the status return for future users.

diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index 56f2df5..705170c 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -121,10 +121,8 @@ _cairo_path_bounder_curve_to (void *closure,
 {
     cairo_path_bounder_t *bounder = closure;
 
-    _cairo_spline_bound (_cairo_path_bounder_line_to, bounder,
-			 &bounder->current_point, b, c, d);
-
-    return CAIRO_STATUS_SUCCESS;
+    return _cairo_spline_bound (_cairo_path_bounder_line_to, bounder,
+				&bounder->current_point, b, c, d);
 }
 
 static cairo_status_t
diff --git a/src/cairo-spline.c b/src/cairo-spline.c
index 85e8a90..414e053 100644
--- a/src/cairo-spline.c
+++ b/src/cairo-spline.c
@@ -210,7 +210,7 @@ _cairo_spline_decompose (cairo_spline_t *spline, double tolerance)
 }
 
 /* Note: this function is only good for computing bounds in device space. */
-void
+cairo_status_t
 _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
 		     void *closure,
 		     const cairo_point_t *p0, const cairo_point_t *p1,
@@ -221,6 +221,7 @@ _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
     double a, b, c;
     double t[4];
     int t_num = 0, i;
+    cairo_status_t status;
 
     x0 = _cairo_fixed_to_double (p0->x);
     y0 = _cairo_fixed_to_double (p0->y);
@@ -317,7 +318,10 @@ _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
     c = -y0 + y1;
     FIND_EXTREMES (a, b, c);
 
-    add_point_func (closure, p0);
+    status = add_point_func (closure, p0);
+    if (unlikely (status))
+	return status;
+
     for (i = 0; i < t_num; i++) {
 	cairo_point_t p;
 	double x, y;
@@ -348,7 +352,10 @@ _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
 
 	p.x = _cairo_fixed_from_double (x);
 	p.y = _cairo_fixed_from_double (y);
-	add_point_func (closure, &p);
+	status = add_point_func (closure, &p);
+	if (unlikely (status))
+	    return status;
     }
-    add_point_func (closure, p3);
+
+    return add_point_func (closure, p3);
 }
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index 2fdb196..149d894 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -305,7 +305,7 @@ typedef struct _cairo_polygon {
     cairo_edge_t  edges_embedded[32];
 } cairo_polygon_t;
 
-typedef cairo_status_t
+typedef cairo_warn cairo_status_t
 (*cairo_spline_add_point_func_t) (void *closure,
 				  const cairo_point_t *point);
 
diff --git a/src/cairoint.h b/src/cairoint.h
index 6024796..a67dff5 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2263,7 +2263,7 @@ _cairo_spline_init (cairo_spline_t *spline,
 cairo_private cairo_status_t
 _cairo_spline_decompose (cairo_spline_t *spline, double tolerance);
 
-cairo_private void
+cairo_private cairo_status_t
 _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
 		     void *closure,
 		     const cairo_point_t *p0, const cairo_point_t *p1,
commit 7df082dd8aaa9d31479a8bb1f6f1dfe07f52019a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 29 16:06:36 2008 +0000

    [test] Update twin reference images
    
    Subsequent to recent tweaks, update the reference images for twin.

diff --git a/test/Makefile.am b/test/Makefile.am
index d4bfbd3..6aa0b8e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -973,10 +973,8 @@ REFERENCE_IMAGES = \
 	trap-clip.ps2.rgb24.ref.png \
 	twin.ref.png \
 	twin.pdf.ref.png \
-	twin.ps2.ref.png \
-	twin.ps3.ref.png \
-	twin.svg11.ref.png \
-	twin.svg12.ref.png \
+	twin.ps.ref.png \
+	twin.svg.ref.png \
 	unantialiased-shapes.ref.png	\
 	unantialiased-shapes.quartz.ref.png \
 	unbounded-operator.ref.png	\
diff --git a/test/twin.c b/test/twin.c
index b04caf5..b71d97e 100644
--- a/test/twin.c
+++ b/test/twin.c
@@ -48,5 +48,5 @@ CAIRO_TEST (twin,
 	    "Tests the internal font",
 	    "twin, font", /* keywords */
 	    NULL, /* requirements */
-	    132, 20,
+	    140, 20,
 	    NULL, draw)
diff --git a/test/twin.pdf.ref.png b/test/twin.pdf.ref.png
deleted file mode 100644
index 366ad9a..0000000
Binary files a/test/twin.pdf.ref.png and /dev/null differ
diff --git a/test/twin.ps.ref.png b/test/twin.ps.ref.png
new file mode 100644
index 0000000..f9374e3
Binary files /dev/null and b/test/twin.ps.ref.png differ
diff --git a/test/twin.ps2.ref.png b/test/twin.ps2.ref.png
deleted file mode 100644
index 7fc3f35..0000000
Binary files a/test/twin.ps2.ref.png and /dev/null differ
diff --git a/test/twin.ps3.ref.png b/test/twin.ps3.ref.png
deleted file mode 100644
index 7fc3f35..0000000
Binary files a/test/twin.ps3.ref.png and /dev/null differ
diff --git a/test/twin.ref.png b/test/twin.ref.png
index 5c1cf2d..8bf098c 100644
Binary files a/test/twin.ref.png and b/test/twin.ref.png differ
diff --git a/test/twin.svg.ref.png b/test/twin.svg.ref.png
new file mode 100644
index 0000000..8b4617f
Binary files /dev/null and b/test/twin.svg.ref.png differ
diff --git a/test/twin.svg11.argb32.ref.png b/test/twin.svg11.argb32.ref.png
deleted file mode 100644
index 0818c67..0000000
Binary files a/test/twin.svg11.argb32.ref.png and /dev/null differ
diff --git a/test/twin.svg11.ref.png b/test/twin.svg11.ref.png
deleted file mode 100644
index 4650396..0000000
Binary files a/test/twin.svg11.ref.png and /dev/null differ
diff --git a/test/twin.svg11.rgb24.ref.png b/test/twin.svg11.rgb24.ref.png
deleted file mode 100644
index 0818c67..0000000
Binary files a/test/twin.svg11.rgb24.ref.png and /dev/null differ
diff --git a/test/twin.svg12.argb32.ref.png b/test/twin.svg12.argb32.ref.png
deleted file mode 100644
index 0818c67..0000000
Binary files a/test/twin.svg12.argb32.ref.png and /dev/null differ
diff --git a/test/twin.svg12.ref.png b/test/twin.svg12.ref.png
deleted file mode 100644
index 4650396..0000000
Binary files a/test/twin.svg12.ref.png and /dev/null differ
diff --git a/test/twin.svg12.rgb24.ref.png b/test/twin.svg12.rgb24.ref.png
deleted file mode 100644
index 0818c67..0000000
Binary files a/test/twin.svg12.rgb24.ref.png and /dev/null differ
commit e10af38799eb77f1a7b5f75e76c733353c7b8622
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 29 12:54:13 2008 +0000

    make "make check" happy again
    
    Add the missing scoping that caused check-plt to complain.

diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c
index c905b27..b834322 100644
--- a/src/cairo-font-face-twin.c
+++ b/src/cairo-font-face-twin.c
@@ -35,9 +35,11 @@
  */
 
 #define _ISOC99_SOURCE /* for round() */
-#include <math.h>
+
 #include "cairoint.h"
 
+#include <math.h>
+
 /*
  * This file implements a user-font rendering the descendant of the Hershey
  * font coded by Keith Packard for use in the Twin window system.
@@ -48,7 +50,7 @@
 
 
 
-cairo_user_data_key_t twin_properties_key;
+static cairo_user_data_key_t twin_properties_key;
 
 
 /*
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 8ffbcb4..5ef484b 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1113,6 +1113,7 @@ cairo_scaled_font_get_user_data (cairo_scaled_font_t	     *scaled_font,
     return _cairo_user_data_array_get_data (&scaled_font->user_data,
 					    key);
 }
+slim_hidden_def (cairo_scaled_font_get_user_data);
 
 /**
  * cairo_scaled_font_set_user_data:
@@ -1144,6 +1145,7 @@ cairo_scaled_font_set_user_data (cairo_scaled_font_t	     *scaled_font,
     return _cairo_user_data_array_set_data (&scaled_font->user_data,
 					    key, user_data, destroy);
 }
+slim_hidden_def (cairo_scaled_font_set_user_data);
 
 static cairo_bool_t
 _cairo_scaled_font_is_frozen (cairo_scaled_font_t *scaled_font)
diff --git a/src/cairo.c b/src/cairo.c
index d7ed78e..a9a5082 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -1160,6 +1160,7 @@ cairo_translate (cairo_t *cr, double tx, double ty)
     if (unlikely (status))
 	_cairo_set_error (cr, status);
 }
+slim_hidden_def (cairo_translate);
 
 /**
  * cairo_scale:
@@ -1233,6 +1234,7 @@ cairo_transform (cairo_t	      *cr,
     if (unlikely (status))
 	_cairo_set_error (cr, status);
 }
+slim_hidden_def (cairo_transform);
 
 /**
  * cairo_set_matrix:
@@ -1293,6 +1295,7 @@ cairo_user_to_device (cairo_t *cr, double *x, double *y)
 
     _cairo_gstate_user_to_device (cr->gstate, x, y);
 }
+slim_hidden_def (cairo_user_to_device);
 
 /**
  * cairo_user_to_device_distance:
@@ -1313,6 +1316,7 @@ cairo_user_to_device_distance (cairo_t *cr, double *dx, double *dy)
 
     _cairo_gstate_user_to_device_distance (cr->gstate, dx, dy);
 }
+slim_hidden_def (cairo_user_to_device_distance);
 
 /**
  * cairo_device_to_user:
diff --git a/src/cairoint.h b/src/cairoint.h
index 2a6681d..6024796 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2263,7 +2263,7 @@ _cairo_spline_init (cairo_spline_t *spline,
 cairo_private cairo_status_t
 _cairo_spline_decompose (cairo_spline_t *spline, double tolerance);
 
-void
+cairo_private void
 _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
 		     void *closure,
 		     const cairo_point_t *p0, const cairo_point_t *p1,
@@ -2613,6 +2613,8 @@ slim_hidden_proto (cairo_scaled_font_get_font_options);
 slim_hidden_proto (cairo_scaled_font_glyph_extents);
 slim_hidden_proto_no_warn (cairo_scaled_font_reference);
 slim_hidden_proto (cairo_scaled_font_status);
+slim_hidden_proto (cairo_scaled_font_get_user_data);
+slim_hidden_proto (cairo_scaled_font_set_user_data);
 slim_hidden_proto (cairo_scaled_font_text_to_glyphs);
 slim_hidden_proto (cairo_set_font_options);
 slim_hidden_proto (cairo_set_font_size);
@@ -2650,10 +2652,14 @@ slim_hidden_proto (cairo_text_cluster_free);
 slim_hidden_proto (cairo_toy_font_face_create);
 slim_hidden_proto (cairo_toy_font_face_get_slant);
 slim_hidden_proto (cairo_toy_font_face_get_weight);
+slim_hidden_proto (cairo_translate);
+slim_hidden_proto (cairo_transform);
 slim_hidden_proto (cairo_user_font_face_create);
 slim_hidden_proto (cairo_user_font_face_set_init_func);
 slim_hidden_proto (cairo_user_font_face_set_render_glyph_func);
 slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func);
+slim_hidden_proto (cairo_user_to_device);
+slim_hidden_proto (cairo_user_to_device_distance);
 slim_hidden_proto (cairo_version_string);
 
 #if CAIRO_HAS_PNG_FUNCTIONS
commit 010085622674bd02098742f401409da8e7c1b1dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 29 12:45:13 2008 +0000

    [path] Remove tolerance from path bounders
    
    With Behdad's analytical analysis of the spline bbox, tolerance is now
    redundant for the path extents and the approximate bounds, so remove it
    from the functions parameters.

diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index b3eab41..b80ad62 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -481,7 +481,7 @@ _cairo_analysis_surface_stroke (void			*abstract_surface,
 	cairo_rectangle_int_t mask_extents;
 
 	_cairo_path_fixed_approximate_stroke_extents (path,
-						      style, ctm, tolerance,
+						      style, ctm,
 						      &mask_extents);
 
 	is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
@@ -539,7 +539,6 @@ _cairo_analysis_surface_fill (void			*abstract_surface,
 	cairo_rectangle_int_t mask_extents;
 
 	_cairo_path_fixed_approximate_fill_extents (path,
-						    tolerance,
 						    &mask_extents);
 
 	is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 9ebc5d1..df7ec5c 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -796,8 +796,7 @@ _cairo_gstate_path_extents (cairo_gstate_t     *gstate,
     double px1, py1, px2, py2;
 
     _cairo_path_fixed_bounds (path,
-			      &px1, &py1, &px2, &py2,
-			      gstate->tolerance);
+			      &px1, &py1, &px2, &py2);
 
     _cairo_gstate_backend_to_user_rectangle (gstate,
 					     &px1, &py1, &px2, &py2,
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index 698d1fa..56f2df5 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -37,8 +37,6 @@
 #include "cairoint.h"
 
 typedef struct cairo_path_bounder {
-    double tolerance;
-
     cairo_point_t current_point;
     cairo_bool_t has_initial_point;
     cairo_bool_t has_point;
@@ -47,9 +45,8 @@ typedef struct cairo_path_bounder {
 } cairo_path_bounder_t;
 
 static void
-_cairo_path_bounder_init (cairo_path_bounder_t *bounder, double tolerance)
+_cairo_path_bounder_init (cairo_path_bounder_t *bounder)
 {
-    bounder->tolerance = tolerance;
     bounder->has_initial_point = FALSE;
     bounder->has_point = FALSE;
 }
@@ -167,7 +164,7 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path,
     cairo_path_bounder_t bounder;
     cairo_status_t status;
 
-    _cairo_path_bounder_init (&bounder, 0.);
+    _cairo_path_bounder_init (&bounder);
 
     status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
 					  _cairo_path_bounder_move_to,
@@ -192,13 +189,12 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path,
  */
 void
 _cairo_path_fixed_approximate_fill_extents (cairo_path_fixed_t *path,
-					    double tolerance,
 					    cairo_rectangle_int_t *extents)
 {
     cairo_path_bounder_t bounder;
     cairo_status_t status;
 
-    _cairo_path_bounder_init (&bounder, tolerance);
+    _cairo_path_bounder_init (&bounder);
 
     status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
 					  _cairo_path_bounder_move_to,
@@ -223,13 +219,12 @@ void
 _cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
 					      cairo_stroke_style_t *style,
 					      const cairo_matrix_t *ctm,
-					      double tolerance,
 					      cairo_rectangle_int_t *extents)
 {
     cairo_path_bounder_t bounder;
     cairo_status_t status;
 
-    _cairo_path_bounder_init (&bounder, tolerance);
+    _cairo_path_bounder_init (&bounder);
 
     status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
 					  _cairo_path_bounder_move_to,
@@ -261,13 +256,12 @@ _cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
 void
 _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
 			  double *x1, double *y1,
-			  double *x2, double *y2,
-			  double tolerance)
+			  double *x2, double *y2)
 {
     cairo_path_bounder_t bounder;
     cairo_status_t status;
 
-    _cairo_path_bounder_init (&bounder, tolerance);
+    _cairo_path_bounder_init (&bounder);
 
     status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
 					  _cairo_path_bounder_move_to,
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 9cd59d4..6cc67d1 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -958,7 +958,6 @@ _cairo_surface_fallback_fill (cairo_surface_t		*surface,
 	    cairo_rectangle_int_t path_extents;
 
 	    _cairo_path_fixed_approximate_fill_extents (path,
-							tolerance,
 							&path_extents);
 	    if (! _cairo_rectangle_intersect (&extents, &path_extents))
 		return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairoint.h b/src/cairoint.h
index 95b5e0f..2a6681d 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1545,21 +1545,18 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t	*path,
 
 cairo_private void
 _cairo_path_fixed_approximate_fill_extents (cairo_path_fixed_t *path,
-					    double tolerance,
 					    cairo_rectangle_int_t *extents);
 
 cairo_private void
 _cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
 					      cairo_stroke_style_t *style,
 					      const cairo_matrix_t *ctm,
-					      double tolerance,
 					      cairo_rectangle_int_t *extents);
 
 cairo_private void
 _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
 			  double *x1, double *y1,
-			  double *x2, double *y2,
-			  double tolerance);
+			  double *x2, double *y2);
 
 cairo_private void
 _cairo_path_fixed_transform (cairo_path_fixed_t	*path,
commit 84b81388bef4a2f300580081415fe09947edb96e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 29 12:16:53 2008 +0000

    [test] Draw spline bbox
    
    Add the stroked extents to the spline-decomposition test.

diff --git a/test/Makefile.am b/test/Makefile.am
index 7e067c8..d4bfbd3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -902,11 +902,9 @@ REFERENCE_IMAGES = \
 	source-surface-scale-paint.ref.png	\
 	source-surface-scale-paint.rgb24.ref.png	\
 	spline-decomposition.ref.png \
-	spline-decomposition.ps2.ref.png \
-	spline-decomposition.ps3.ref.png \
+	spline-decomposition.ps.ref.png \
 	spline-decomposition.pdf.ref.png \
-	spline-decomposition.svg11.ref.png \
-	spline-decomposition.svg12.ref.png \
+	spline-decomposition.svg.ref.png \
 	stroke-ctm-caps.ps2.ref.png \
 	stroke-ctm-caps.ps3.ref.png \
 	surface-pattern-big-scale-down.ref.png	\
diff --git a/test/spline-decomposition.c b/test/spline-decomposition.c
index f01a505..ea8f26f 100644
--- a/test/spline-decomposition.c
+++ b/test/spline-decomposition.c
@@ -310,8 +310,20 @@ thin_splines (cairo_t *cr)
 #endif
 
 static void
+draw_bbox (cairo_t *cr, double x0, double y0, double x1, double y1)
+{
+    cairo_rectangle (cr,
+		     floor (x0) + .5, floor (y0) + .5,
+		     ceil (x1) - floor (x0), ceil (y1) - floor (y0));
+    cairo_stroke (cr);
+}
+
+static void
 stroke_splines (cairo_t *cr)
 {
+    double stroke_x0, stroke_x1, stroke_y0, stroke_y1;
+    double path_x0, path_x1, path_y0, path_y1;
+
     cairo_save (cr);
     cairo_translate (cr, 15, 15);
 
@@ -322,8 +334,18 @@ stroke_splines (cairo_t *cr)
 		    knots[0].b.x, knots[0].b.y,
 		    knots[0].c.x, knots[0].c.y,
 		    knots[0].d.x, knots[0].d.y);
+    cairo_stroke_extents (cr, &stroke_x0, &stroke_y0, &stroke_x1, &stroke_y1);
+    cairo_path_extents (cr, &path_x0, &path_y0, &path_x1, &path_y1);
     cairo_stroke (cr);
 
+    cairo_save (cr); {
+	cairo_set_line_width (cr, 1);
+	cairo_set_source_rgb (cr, 1, 0, 0);
+	draw_bbox (cr, stroke_x0, stroke_y0, stroke_x1, stroke_y1);
+	cairo_set_source_rgb (cr, 0, 0, 1);
+	draw_bbox (cr, path_x0, path_y0, path_x1, path_y1);
+    } cairo_restore (cr);
+
     cairo_translate (cr, 130, 0);
 
     cairo_new_path (cr);
@@ -333,8 +355,18 @@ stroke_splines (cairo_t *cr)
 		    knots[1].b.x, knots[1].b.y,
 		    knots[1].c.x, knots[1].c.y,
 		    knots[1].d.x, knots[1].d.y);
+    cairo_stroke_extents (cr, &stroke_x0, &stroke_y0, &stroke_x1, &stroke_y1);
+    cairo_path_extents (cr, &path_x0, &path_y0, &path_x1, &path_y1);
     cairo_stroke (cr);
 
+    cairo_save (cr); {
+	cairo_set_line_width (cr, 1);
+	cairo_set_source_rgb (cr, 1, 0, 0);
+	draw_bbox (cr, stroke_x0, stroke_y0, stroke_x1, stroke_y1);
+	cairo_set_source_rgb (cr, 0, 0, 1);
+	draw_bbox (cr, path_x0, path_y0, path_x1, path_y1);
+    } cairo_restore (cr);
+
     cairo_translate (cr, 130, 0);
 
     cairo_new_path (cr);
@@ -344,8 +376,18 @@ stroke_splines (cairo_t *cr)
 		    knots[2].b.x, knots[2].b.y,
 		    knots[2].c.x, knots[2].c.y,
 		    knots[2].d.x, knots[2].d.y);
+    cairo_stroke_extents (cr, &stroke_x0, &stroke_y0, &stroke_x1, &stroke_y1);
+    cairo_path_extents (cr, &path_x0, &path_y0, &path_x1, &path_y1);
     cairo_stroke (cr);
 
+    cairo_save (cr); {
+	cairo_set_line_width (cr, 1);
+	cairo_set_source_rgb (cr, 1, 0, 0);
+	draw_bbox (cr, stroke_x0, stroke_y0, stroke_x1, stroke_y1);
+	cairo_set_source_rgb (cr, 0, 0, 1);
+	draw_bbox (cr, path_x0, path_y0, path_x1, path_y1);
+    } cairo_restore (cr);
+
     cairo_translate (cr, -130 - 65, 130);
 
     cairo_new_path (cr);
@@ -355,8 +397,18 @@ stroke_splines (cairo_t *cr)
 		    knots[3].b.x, knots[3].b.y,
 		    knots[3].c.x, knots[3].c.y,
 		    knots[3].d.x, knots[3].d.y);
+    cairo_stroke_extents (cr, &stroke_x0, &stroke_y0, &stroke_x1, &stroke_y1);
+    cairo_path_extents (cr, &path_x0, &path_y0, &path_x1, &path_y1);
     cairo_stroke (cr);
 
+    cairo_save (cr); {
+	cairo_set_line_width (cr, 1);
+	cairo_set_source_rgb (cr, 1, 0, 0);
+	draw_bbox (cr, stroke_x0, stroke_y0, stroke_x1, stroke_y1);
+	cairo_set_source_rgb (cr, 0, 0, 1);
+	draw_bbox (cr, path_x0, path_y0, path_x1, path_y1);
+    } cairo_restore (cr);
+
     cairo_translate (cr, 130, 0);
 
     cairo_new_path (cr);
@@ -366,7 +418,18 @@ stroke_splines (cairo_t *cr)
 		    knots[4].b.x, knots[4].b.y,
 		    knots[4].c.x, knots[4].c.y,
 		    knots[4].d.x, knots[4].d.y);
+    cairo_stroke_extents (cr, &stroke_x0, &stroke_y0, &stroke_x1, &stroke_y1);
+    cairo_path_extents (cr, &path_x0, &path_y0, &path_x1, &path_y1);
     cairo_stroke (cr);
+
+    cairo_save (cr); {
+	cairo_set_line_width (cr, 1);
+	cairo_set_source_rgb (cr, 1, 0, 0);
+	draw_bbox (cr, stroke_x0, stroke_y0, stroke_x1, stroke_y1);
+	cairo_set_source_rgb (cr, 0, 0, 1);
+	draw_bbox (cr, path_x0, path_y0, path_x1, path_y1);
+    } cairo_restore (cr);
+
     cairo_restore (cr);
 }
 
diff --git a/test/spline-decomposition.pdf.ref.png b/test/spline-decomposition.pdf.ref.png
index 4fd25a6..9ea094a 100644
Binary files a/test/spline-decomposition.pdf.ref.png and b/test/spline-decomposition.pdf.ref.png differ
diff --git a/test/spline-decomposition.ps.ref.png b/test/spline-decomposition.ps.ref.png
new file mode 100644
index 0000000..2b3c07d
Binary files /dev/null and b/test/spline-decomposition.ps.ref.png differ
diff --git a/test/spline-decomposition.ps2.ref.png b/test/spline-decomposition.ps2.ref.png
deleted file mode 100644
index ca1fbfd..0000000
Binary files a/test/spline-decomposition.ps2.ref.png and /dev/null differ
diff --git a/test/spline-decomposition.ps3.ref.png b/test/spline-decomposition.ps3.ref.png
deleted file mode 100644
index ca1fbfd..0000000
Binary files a/test/spline-decomposition.ps3.ref.png and /dev/null differ
diff --git a/test/spline-decomposition.ref.png b/test/spline-decomposition.ref.png
index 4e1b344..bac35a9 100644
Binary files a/test/spline-decomposition.ref.png and b/test/spline-decomposition.ref.png differ
diff --git a/test/spline-decomposition.svg.ref.png b/test/spline-decomposition.svg.ref.png
new file mode 100644
index 0000000..9ea094a
Binary files /dev/null and b/test/spline-decomposition.svg.ref.png differ
diff --git a/test/spline-decomposition.svg11.ref.png b/test/spline-decomposition.svg11.ref.png
deleted file mode 100644
index 4fd25a6..0000000
Binary files a/test/spline-decomposition.svg11.ref.png and /dev/null differ
diff --git a/test/spline-decomposition.svg12.ref.png b/test/spline-decomposition.svg12.ref.png
deleted file mode 100644
index 4fd25a6..0000000
Binary files a/test/spline-decomposition.svg12.ref.png and /dev/null differ


More information about the cairo-commit mailing list