diff --git a/test/Makefile.am b/test/Makefile.am index 7e067c84d..d4bfbd384 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 f01a505e9..ea8f26f23 100644 --- a/test/spline-decomposition.c +++ b/test/spline-decomposition.c @@ -309,9 +309,21 @@ 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 4fd25a62b..9ea094a72 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 000000000..2b3c07dcc 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 ca1fbfd6f..000000000 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 ca1fbfd6f..000000000 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 4e1b3448a..bac35a9cd 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 000000000..9ea094a72 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 4fd25a62b..000000000 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 4fd25a62b..000000000 Binary files a/test/spline-decomposition.svg12.ref.png and /dev/null differ