From e54787b78d414d1f0ec5c139ac3c29904a5e3610 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 19 Sep 2005 17:27:22 +0000 Subject: [PATCH] =?UTF-8?q?Avoid=20attempting=20to=20create=20a=20size-0?= =?UTF-8?q?=20Pixmap,=20(to=20prevent=20the=20associated=20X=20error).=20T?= =?UTF-8?q?his=20actually=20showed=20up=20when=20the=20clip=20region=20is?= =?UTF-8?q?=20empty.=20Thanks=20to=20Radek=20Doul=C3=ADk=20for=20the=20bug?= =?UTF-8?q?=20report.=20Remove=20clip-all=20from=20the=20XFAIL=20list=20si?= =?UTF-8?q?nce=20it=20works=20now.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 11 +++++++++++ src/cairo-xlib-surface.c | 3 ++- test/Makefile.am | 1 - test/clip-all.c | 3 +-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79625622c..c0c1c6703 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-09-19 Carl Worth + + * src/cairo-xlib-surface.c: (_create_a8_picture): Avoid attempting + to create a size-0 Pixmap, (to prevent the associated X + error). This actually showed up when the clip region is + empty. Thanks to Radek DoulĂ­k for the bug report. + + * test/Makefile.am: + * test/clip-all.c: (main): Remove clip-all from the XFAIL list + since it works now. + 2005-09-19 Carl Worth Originally: 2005-09-19 Hans Breuer diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index e3955ecad..9d1f7199d 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -1352,7 +1352,8 @@ _create_a8_picture (cairo_xlib_surface_t *surface, unsigned long mask = 0; Pixmap pixmap = XCreatePixmap (surface->dpy, surface->drawable, - width, height, + width <= 0 ? 1 : width, + height <= 0 ? 1 : height, 8); Picture picture; diff --git a/test/Makefile.am b/test/Makefile.am index a92f13745..6f2bbba39 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -146,7 +146,6 @@ rel-path-ref.png # provide an explanation for the expected failure. XFAIL_TESTS = \ a8-mask \ -clip-all \ filter-nearest-offset \ pixman-rotate \ self-intersecting \ diff --git a/test/clip-all.c b/test/clip-all.c index 428445bcb..0fbcc4ac1 100644 --- a/test/clip-all.c +++ b/test/clip-all.c @@ -65,6 +65,5 @@ draw (cairo_t *cr, int width, int height) int main (void) { - return cairo_test_expect_failure (&test, draw, - "Need to avoid trying to create size-0 Pixmaps in cairo-xlib"); + return cairo_test (&test, draw); }