commit 3571e0423f9128c8d5e844a3f8a51f2b9280b640 Author: Benjamin Otte Date: Mon Sep 18 18:04:33 2006 +0200 Add a new test diff --git a/test/Makefile.am b/test/Makefile.am index 111f1c1..57aa01a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -40,6 +40,7 @@ glyph-cache-pressure \ get-and-set \ get-group-target \ gradient-alpha \ +huge-pattern \ leaky-dash \ leaky-polygon \ line-width \ @@ -230,6 +231,7 @@ glyph-cache-pressure-ps-argb32-ref.png glyph-cache-pressure-svg-ref.png \ gradient-alpha-ref.png \ gradient-alpha-rgb24-ref.png \ +huge-pattern-ref.png \ leaky-dash-ref.png \ leaky-polygon-ref.png \ leaky-polygon-ps-argb32-ref.png \ diff --git a/test/huge-pattern-ref.png b/test/huge-pattern-ref.png new file mode 100644 index 0000000..68f86b4 Binary files /dev/null and b/test/huge-pattern-ref.png differ diff --git a/test/huge-pattern.c b/test/huge-pattern.c new file mode 100644 index 0000000..47f6546 --- /dev/null +++ b/test/huge-pattern.c @@ -0,0 +1,44 @@ +#include +#include "cairo-test.h" +#include + +static cairo_test_draw_function_t draw; + +cairo_test_t test = { + "huge-pattern", + "Test huge linear patterns" + "\nhuge patterns seem to not be drawn correctly", + 600, 350, + draw +}; + +/* set this to 0.1 to make this test work */ +#define FACTOR 1 + +static cairo_test_status_t +draw (cairo_t *cr, int width, int height) +{ + cairo_pattern_t *pattern; + cairo_matrix_t mat = { -0, -4.5254285714285709 * FACTOR, -2.6398333333333333 * FACTOR, -0, 0, 0 }; + + pattern = cairo_pattern_create_linear (-16384 * FACTOR, 0, 16384 * FACTOR, 0); + cairo_pattern_add_color_stop_rgba (pattern, 0, 0.376471, 0.533333, 0.27451, 1); + cairo_pattern_add_color_stop_rgba (pattern, 1, 1, 1, 1, 1); + cairo_pattern_set_matrix (pattern, &mat); + + cairo_scale (cr, 0.05, 0.05); + cairo_translate (cr, 6000, 3500); + + cairo_set_source (cr, pattern); + cairo_rectangle (cr, -6000, -3500, 12000, 7000); + cairo_pattern_destroy (pattern); + cairo_fill (cr); + + return CAIRO_TEST_SUCCESS; +} + +int +main (void) +{ + return cairo_test (&test); +}