From b86a5cd30fa15164f1201d023e75b03fe8e01ac0 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 16 Jan 2013 06:32:34 +0000 Subject: [PATCH] fix pixman wrappers where image size and alloc size differ. SVN revision: 82856 --- ChangeLog | 5 +++++ NEWS | 1 + src/lib/evas/common/evas_image_main.c | 20 +++++++++++--------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 421e2e3397..882aae4b1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-16 Carsten Haitzler (The Rasterman) + + * Fixed pixman image wrapping to handle allocated size instead + of image size (unless allocated is 0/wrong). + 2013-01-15 Paulo Alcantara (pcacjr) * Evas engines: Introduce multi_font_draw() function diff --git a/NEWS b/NEWS index 34437a01ee..853f0420d7 100644 --- a/NEWS +++ b/NEWS @@ -118,3 +118,4 @@ Fixes: * Evas textblock: Fixed issue and simplified cursor_geometry_get. * Evas text: Fixed issue with horiz advance. * Evas text utils: Fixed issue with no-harfbuzz bidi. + * Fixed pixman surface alloc where allocated and image size differ. diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index 6692a2dbcd..0677bfae31 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -313,8 +313,16 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie) #ifdef HAVE_PIXMAN # ifdef PIXMAN_IMAGE RGBA_Image *im = (RGBA_Image *)ie; - + int w, h; + if (im->pixman.im) pixman_image_unref(im->pixman.im); + w = ie->allocated.w; + h = ie->allocated.h; + if ((w <= 0) || (h <= 0)) + { + w = im->cache_entry.w; + h = im->cache_entry.h; + } if (im->cache_entry.flags.alpha) { im->pixman.im = pixman_image_create_bits @@ -322,10 +330,7 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie) // FIXME: endianess determines this PIXMAN_a8r8g8b8, // PIXMAN_b8g8r8a8, - im->cache_entry.w, im->cache_entry.h, - im->image.data, - im->cache_entry.w * 4 - ); + w, h, im->image.data, w * 4); } else { @@ -334,10 +339,7 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie) // FIXME: endianess determines this PIXMAN_x8r8g8b8, // PIXMAN_b8g8r8x8, - im->cache_entry.w, im->cache_entry.h, - im->image.data, - im->cache_entry.w * 4 - ); + w, h, im->image.data, w * 4); } # else (void)ie;