diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-23 12:58:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-24 12:35:47 +0100 |
commit | 80359e73d821516f411b25b977b442869fa5d0ad (patch) | |
tree | bbd1b994e5c52399b3f7e3addda86ae3fe20d3aa | |
parent | 06a737b74d3bc925a2c32254f497e07b6d1af5ca (diff) | |
download | cairo-80359e73d821516f411b25b977b442869fa5d0ad.tar.gz |
test: Exercise stroking bugs with xlib/trapezoids
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | test/Makefile.sources | 1 | ||||
-rw-r--r-- | test/bug-84115.c | 61 | ||||
-rw-r--r-- | test/reference/bug-84115.ref.png | bin | 0 -> 64233 bytes | |||
-rw-r--r-- | test/reference/bug-84115.xlib.ref.png | bin | 0 -> 65033 bytes |
4 files changed, 62 insertions, 0 deletions
diff --git a/test/Makefile.sources b/test/Makefile.sources index 689645c50..7e80b90c1 100644 --- a/test/Makefile.sources +++ b/test/Makefile.sources @@ -26,6 +26,7 @@ test_sources = \ bilevel-image.c \ bug-40410.c \ bug-51910.c \ + bug-84115.c \ bug-bo-rectangular.c \ bug-bo-collins.c \ bug-bo-ricotz.c \ diff --git a/test/bug-84115.c b/test/bug-84115.c new file mode 100644 index 000000000..4db113c5c --- /dev/null +++ b/test/bug-84115.c @@ -0,0 +1,61 @@ +/* + * Copyright © 2011 Krzysztof Kosiński + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Author: Krzysztof Kosiński <tweenk.pl@gmail.com> + */ + +#include "cairo-test.h" + +#define WIDTH 800 +#define HEIGHT 800 + +static cairo_test_status_t +draw (cairo_t *cr, int width, int height) +{ + double lw = 800; + int n = 0; + + cairo_set_source_rgb (cr, 1,1,1); + cairo_paint (cr); + + cairo_set_source_rgba (cr, 0, 0, 0, .4); + cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); + do { + cairo_set_line_width(cr, lw); + cairo_arc(cr, WIDTH/2, HEIGHT/2, lw/2, + 2*M_PI*(13*n + 1) / 130, 2*M_PI*(13*n + 12) / 130); + cairo_stroke(cr); + + n++; + lw /= 1.1; + } while (lw > 0.5); + + return CAIRO_TEST_SUCCESS; +} + +CAIRO_TEST (bug_84115, + "Exercises a bug found in stroke generation using trapezoids", + "stroke", /* keywords */ + NULL, /* requirements */ + WIDTH, HEIGHT, + NULL, draw) diff --git a/test/reference/bug-84115.ref.png b/test/reference/bug-84115.ref.png Binary files differnew file mode 100644 index 000000000..f249ba56f --- /dev/null +++ b/test/reference/bug-84115.ref.png diff --git a/test/reference/bug-84115.xlib.ref.png b/test/reference/bug-84115.xlib.ref.png Binary files differnew file mode 100644 index 000000000..2e17a6570 --- /dev/null +++ b/test/reference/bug-84115.xlib.ref.png |