summaryrefslogtreecommitdiff
path: root/test/caps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-04 11:34:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-04 11:52:26 +0100
commita2d852497364afa742518ac0d9feb0466dccc191 (patch)
tree11a1766bc4e1cbe6f5cd1f724bce1dd1fc906c6d /test/caps.c
parent85c2a0d76ab109f2bec8f7dccab577033e6d37b0 (diff)
downloadcairo-a2d852497364afa742518ac0d9feb0466dccc191.tar.gz
test: Expand testing of caps for fine strokes
Diffstat (limited to 'test/caps.c')
-rw-r--r--test/caps.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/test/caps.c b/test/caps.c
index 7f5611791..cde2773f9 100644
--- a/test/caps.c
+++ b/test/caps.c
@@ -45,14 +45,13 @@ make_path (cairo_t *cr)
}
static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
+draw (cairo_t *cr)
{
cairo_save (cr);
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
cairo_paint (cr);
cairo_restore (cr);
- cairo_set_line_width (cr, LINE_WIDTH);
cairo_translate (cr, PAD + SIZE / 2., PAD + SIZE / 2.);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
@@ -77,11 +76,63 @@ draw (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
+static cairo_test_status_t
+draw_10 (cairo_t *cr, int width, int height)
+{
+ cairo_set_line_width (cr, LINE_WIDTH);
+ return draw (cr);
+}
+
+static cairo_test_status_t
+draw_2 (cairo_t *cr, int width, int height)
+{
+ cairo_set_line_width (cr, 2);
+ return draw (cr);
+}
+
+static cairo_test_status_t
+draw_1 (cairo_t *cr, int width, int height)
+{
+ cairo_set_line_width (cr, 1);
+ return draw (cr);
+}
+
+static cairo_test_status_t
+draw_05 (cairo_t *cr, int width, int height)
+{
+ cairo_set_line_width (cr, 0.5);
+ return draw (cr);
+}
+
CAIRO_TEST (caps,
"Test caps",
"stroke caps", /* keywords */
NULL, /* requirements */
PAD + SIZE + PAD,
3 * (PAD + SIZE) + PAD,
- NULL, draw)
+ NULL, draw_10)
+
+CAIRO_TEST (caps_2,
+ "Test normal caps",
+ "stroke caps", /* keywords */
+ NULL, /* requirements */
+ PAD + SIZE + PAD,
+ 3 * (PAD + SIZE) + PAD,
+ NULL, draw_2)
+
+CAIRO_TEST (caps_1,
+ "Test hairline caps",
+ "stroke caps", /* keywords */
+ NULL, /* requirements */
+ PAD + SIZE + PAD,
+ 3 * (PAD + SIZE) + PAD,
+ NULL, draw_1)
+
+CAIRO_TEST (caps_05,
+ "Test fine caps",
+ "stroke caps", /* keywords */
+ NULL, /* requirements */
+ PAD + SIZE + PAD,
+ 3 * (PAD + SIZE) + PAD,
+ NULL, draw_05)