From de25fec06bbdbb3cf458aefb4e3b9d2271022b9c Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 27 Jul 2011 21:50:45 +0200 Subject: [PATCH] test: Improve horizontal-clip The bug pointed out by this test now causes failures in xcb and xlib. --- test/horizontal-clip.c | 39 ++++++++++++++++++----------------- test/horizontal-clip.ref.png | Bin 115 -> 129 bytes 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/test/horizontal-clip.c b/test/horizontal-clip.c index 2a5025cfc..93127a722 100644 --- a/test/horizontal-clip.c +++ b/test/horizontal-clip.c @@ -29,10 +29,11 @@ #include "cairo-test.h" -#define WIDTH 20 -#define HEIGHT 20 +#define WIDTH 16 +#define HEIGHT 26 -#define BUG 1 +#define BUGY 1 +#define BUGX (4 * BUGY * WIDTH * 256) static cairo_test_status_t draw (cairo_t *cr, int width, int height) @@ -41,28 +42,28 @@ draw (cairo_t *cr, int width, int height) cairo_paint (cr); cairo_set_source_rgb (cr, 0, 0, 0); - cairo_move_to (cr, 0-256, 4 - BUG); - cairo_line_to (cr, WIDTH + 256, 4 + BUG); - cairo_line_to (cr, WIDTH + 256, 2 - BUG); - cairo_line_to (cr, 0-256, 2 + BUG); + cairo_move_to (cr, - BUGX, 6 - BUGY); + cairo_line_to (cr, + BUGX, 6 + BUGY); + cairo_line_to (cr, WIDTH + BUGX, 2 - BUGY); + cairo_line_to (cr, WIDTH - BUGX, 2 + BUGY); cairo_fill (cr); - cairo_move_to (cr, 0-256, 6 - BUG); - cairo_line_to (cr, WIDTH + 256, 6 + BUG); - cairo_line_to (cr, WIDTH + 256, 8 - BUG); - cairo_line_to (cr, 0-256, 8 + BUG); + cairo_move_to (cr, WIDTH + BUGX, 8 - BUGY); + cairo_line_to (cr, WIDTH - BUGX, 8 + BUGY); + cairo_line_to (cr, - BUGX, 12 - BUGY); + cairo_line_to (cr, + BUGX, 12 + BUGY); cairo_fill (cr); - cairo_move_to (cr, WIDTH+256, 12 - BUG); - cairo_line_to (cr, 0-256, 12 + BUG); - cairo_line_to (cr, 0-256, 14 - BUG); - cairo_line_to (cr, WIDTH+256, 14 + BUG); + cairo_move_to (cr, - BUGX, 14 - BUGY); + cairo_line_to (cr, + BUGX, 14 + BUGY); + cairo_line_to (cr, WIDTH + BUGX, 18 - BUGY); + cairo_line_to (cr, WIDTH - BUGX, 18 + BUGY); cairo_fill (cr); - cairo_move_to (cr, WIDTH+256, 18 - BUG); - cairo_line_to (cr, 0-256, 18 + BUG); - cairo_line_to (cr, 0-256, 16 - BUG); - cairo_line_to (cr, WIDTH+256, 16 + BUG); + cairo_move_to (cr, WIDTH + BUGX, 24 - BUGY); + cairo_line_to (cr, WIDTH - BUGX, 24 + BUGY); + cairo_line_to (cr, - BUGX, 20 - BUGY); + cairo_line_to (cr, + BUGX, 20 + BUGY); cairo_fill (cr); return CAIRO_TEST_SUCCESS; diff --git a/test/horizontal-clip.ref.png b/test/horizontal-clip.ref.png index 51d9445783cd1179dcde0ee2fc39caef704f82ee..f07e03578c1838ae8c2c21391a9e7a6a657e0093 100644 GIT binary patch delta 116 zcmXSJWK`@7@N?(olHy`uVBq!ia0vp^0zfRq!2~1?xx51=DvElWdAc};So9|U`TyUZ zS+k*2zopr0O5!ui2wiq delta 102 zcmZo@Q- BA94Ty