summaryrefslogtreecommitdiff
path: root/test/bug-image-compositor.c
diff options
context:
space:
mode:
authorHeiko Lewin <heiko.lewin@worldiety.de>2020-12-15 16:48:19 +0100
committerHeiko Lewin <heiko.lewin@worldiety.de>2020-12-15 16:48:19 +0100
commit03a820b173ed1fdef6ff14b4468f5dbc02ff59be (patch)
tree6c8b95df7a967341ad17ae44acec2e2ecc337c0e /test/bug-image-compositor.c
parente22d7212acb454daccc088619ee147af03883974 (diff)
downloadcairo-03a820b173ed1fdef6ff14b4468f5dbc02ff59be.tar.gz
Fix mask usage in image-compositor
Diffstat (limited to 'test/bug-image-compositor.c')
-rw-r--r--test/bug-image-compositor.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/bug-image-compositor.c b/test/bug-image-compositor.c
new file mode 100644
index 000000000..fc4fd370b
--- /dev/null
+++ b/test/bug-image-compositor.c
@@ -0,0 +1,39 @@
+#include "cairo-test.h"
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_set_source_rgb (cr, 0., 0., 0.);
+ cairo_paint (cr);
+
+ cairo_set_source_rgb (cr, 1., 1., 1.);
+ cairo_set_line_width (cr, 1.);
+
+ cairo_pattern_t *p = cairo_pattern_create_linear (0, 0, width, height);
+ cairo_pattern_add_color_stop_rgb (p, 0, 0.99, 1, 1);
+ cairo_pattern_add_color_stop_rgb (p, 1, 1, 1, 1);
+ cairo_set_source (cr, p);
+
+ cairo_move_to (cr, 0.5, -1);
+ for (int i = 0; i < width; i+=3) {
+ cairo_rel_line_to (cr, 2, 2);
+ cairo_rel_line_to (cr, 1, -2);
+ }
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_stroke (cr);
+
+ cairo_pattern_destroy(p);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+
+CAIRO_TEST (bug_image_compositor,
+ "Crash in image-compositor",
+ "stroke, stress", /* keywords */
+ NULL, /* requirements */
+ 10000, 1,
+ NULL, draw)
+
+