summaryrefslogtreecommitdiff
path: root/test/paint-with-alpha.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-24 10:41:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-24 11:50:48 +0100
commit4d5c95f6296b606c7fba31a75211129119ad9e2c (patch)
treece83e740f1f100cc3eb031570dabfc5b42670d66 /test/paint-with-alpha.c
parent2b19dd3fbd9ea8d44c9cccbb9ae28b81992b4483 (diff)
downloadcairo-4d5c95f6296b606c7fba31a75211129119ad9e2c.tar.gz
test: Exercise replaying basic painting paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/paint-with-alpha.c')
-rw-r--r--test/paint-with-alpha.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/paint-with-alpha.c b/test/paint-with-alpha.c
index e827bb942..8daa935f7 100644
--- a/test/paint-with-alpha.c
+++ b/test/paint-with-alpha.c
@@ -94,6 +94,34 @@ draw_clip (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
+static cairo_test_status_t
+draw_clip_mask (cairo_t *cr, int width, int height)
+{
+ cairo_surface_t *surface;
+
+ surface = cairo_image_surface_create_for_data ((unsigned char *) data,
+ CAIRO_FORMAT_RGB24, 4, 4, 16);
+
+ cairo_test_paint_checkered (cr);
+
+ cairo_move_to (cr, 16, 5);
+ cairo_line_to (cr, 5, 16);
+ cairo_line_to (cr, 16, 27);
+ cairo_line_to (cr, 27, 16);
+ cairo_clip (cr);
+
+ cairo_scale (cr, 4, 4);
+
+ cairo_set_source_surface (cr, surface, 2 , 2);
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
+ cairo_paint_with_alpha (cr, 0.5);
+
+ cairo_surface_finish (surface); /* data will go out of scope */
+ cairo_surface_destroy (surface);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
CAIRO_TEST (paint_with_alpha,
"Simple test of cairo_paint_with_alpha",
"paint, alpha", /* keywords */
@@ -112,3 +140,9 @@ CAIRO_TEST (paint_with_alpha_clip,
NULL, /* requirements */
32, 32,
NULL, draw_clip)
+CAIRO_TEST (paint_with_alpha_clip_mask,
+ "Simple test of cairo_paint_with_alpha+unaligned clip",
+ "paint, alpha, clip", /* keywords */
+ NULL, /* requirements */
+ 32, 32,
+ NULL, draw_clip_mask)