From f2645fa361003636d1da6ca38c3b61fef1b1ce4d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 17 Jun 2010 15:38:53 +0100 Subject: [PATCH] test: Add a1-bug Capture a bug report from "cairouser" where a1 rasterisation is now broken. --- test/Makefile.am | 3 ++ test/Makefile.sources | 1 + test/a1-bug.c | 61 ++++++++++++++++++++++++++++++++++++ test/a1-bug.image16.ref.png | Bin 0 -> 3329 bytes test/a1-bug.ref.png | Bin 0 -> 3736 bytes test/a1-bug.xlib.ref.png | Bin 0 -> 3362 bytes 6 files changed, 65 insertions(+) create mode 100644 test/a1-bug.c create mode 100644 test/a1-bug.image16.ref.png create mode 100644 test/a1-bug.ref.png create mode 100644 test/a1-bug.xlib.ref.png diff --git a/test/Makefile.am b/test/Makefile.am index a7f1845fc..7b4bf8af7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -131,6 +131,9 @@ CLEANFILES += $(BUILT_SOURCES) # All tests which have a reference image go here. REFERENCE_IMAGES = \ + a1-bug.ref.png \ + a1-bug.image16.ref.png \ + a1-bug.xlib.ref.png \ a1-image-sample.ref.png \ a1-image-sample.gl.xfail.png \ a1-image-sample.quartz.xfail.png \ diff --git a/test/Makefile.sources b/test/Makefile.sources index 243b53af5..c91f871c1 100644 --- a/test/Makefile.sources +++ b/test/Makefile.sources @@ -1,4 +1,5 @@ test_sources = \ + a1-bug.c \ a1-image-sample.c \ a1-mask.c \ a1-mask-sample.c \ diff --git a/test/a1-bug.c b/test/a1-bug.c new file mode 100644 index 000000000..bdbecea72 --- /dev/null +++ b/test/a1-bug.c @@ -0,0 +1,61 @@ +/* + * 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. + */ + +#include "cairo-test.h" + +static cairo_test_status_t +draw (cairo_t *cr, int width, int height) +{ + static const struct point { + double x; + double y; + } xy[] = { + { 627.016212, 221.749777 }, + { 756.120787, 221.749777 }, + { 756.120787, 557.602766 }, + { 626.952721, 557.602766 }, + { 626.548456, 493.315729 }, + }; + unsigned int i; + + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_paint (cr); + + for (i = 0; i < sizeof (xy) / sizeof (xy[0]); i++) + cairo_line_to (cr, xy[i].x, xy[i].y); + + cairo_set_source_rgb (cr, 1, 0, 0); + cairo_fill_preserve (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + cairo_set_source_rgb (cr, 0, 1, 0); + cairo_fill (cr); + + return CAIRO_TEST_SUCCESS; +} + +CAIRO_TEST (a1_bug, + "Check the fidelity of the rasterisation.", + "a1 raster", /* keywords */ + "target=raster", /* requirements */ + 1000, 800, + NULL, draw) diff --git a/test/a1-bug.image16.ref.png b/test/a1-bug.image16.ref.png new file mode 100644 index 0000000000000000000000000000000000000000..48ce4b65a6768570f3ac895f0339c5109b769f3b GIT binary patch literal 3329 zcmeAS@N?(olHy`uVBq!ia0y~yV15C_3LH#85&Nq9SwM;{$=lt9;Xep2*t>i(0|U=C zPZ!6KiaBrZZk!n6D8PEqcFBIZ1pZ^m+;Vp^6PUdGO-xgwJ{*x+m>j1M)ISPFLtp?y z;K%XW9Das|)qift9XNmeb#^uL9ECfK30K~~W&FSQz5M$4+tLqO@^3RUFf{BJe#gKd z0F-4=aM;1j;LuRO&d|W{kdJ|Z@sKP715=AN0|N_3IRgWS0F@O=dJ~T^P4Tk5xF+513U1II2 z%pXms_!6PPGg`+mu-rOubhIP_71If4uH#AW2|bTP9?0M*@(i98<0%jgj-6k5z!FC` z!f)=eLal;694SQN^G-a4n8f4fc-)KE+{YH87VbDom7bq>@RT_{AB*w07iMnw#~M(B ia1@M&z)%eVjo-|RKZ-2O`x|%zi(0|TG0 zr;B4q#hkZy5Bf4Yints!?G)fyIhn(8^Xyd|&rqS%xU;CoPb9t`R9S8Zs)78&qol`;+0LS(RLI3~& literal 0 HcmV?d00001 diff --git a/test/a1-bug.xlib.ref.png b/test/a1-bug.xlib.ref.png new file mode 100644 index 0000000000000000000000000000000000000000..4b08e068322fd4db1b6a9a6b75735b3daa2687c1 GIT binary patch literal 3362 zcmeAS@N?(olHy`uVBq!ia0y~yV15C_3LH#85&Nq9SwM;{$=lt9;Xep2*t>i(0|U=> zPZ!6KiaBqu-Od#W5MVtR8z-bcnen24)kFa%iIZ*;!c6i#reBt7HGMX{Je?b8#3&dI zfdLGGKabblW@dPxF@GETho40|Z{K6^cih2zV8!vbjQ{ucUq3zlE$;`BdAa;RC;s!< z!OY;$P{7X6!0?cdfr0UmECT~mi!}oS3r9Hv1Bbvn1_l9zJB$np4pdf{(6gP(Mpm4S z;n<%0atty9<_^+)c3{TqZwwC-fT48kP7XfL|9ykch{XLZ%Z5b?P3_!6!M)GMe z%-_b&z%Klb!Qk0bXzrv>8AgUU)d+tFBz5_GDNl4s1JMY4@wL_zen8Nzl9cW5S zICGbTKuVT_hiw@&O%q*7B<};(F`yzc;mmrHTng9rmlT)Q<-u(GPJ(UVl+yEa7bLwm z8200diUvdbZR`a*WAe7M4`B5^YV~LcP#gju#Os(Ds>SBD-AG&tGR)J}&t;ucLK6Vf CG~qV@ literal 0 HcmV?d00001