[maemo-commits] [maemo-commits] r13836 - in projects/haf/trunk/sapwood: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Sep 17 14:10:14 EEST 2007
Author: tko
Date: 2007-09-17 14:10:11 +0300 (Mon, 17 Sep 2007)
New Revision: 13836

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-render.c
Log:
Ensure there's a mask available also when centering pixmaps with masks.

2007-09-17  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/sapwood-render.c (theme_pixbuf_render): Ensure there's a mask
	available also when centering pixmaps with masks. Otherwise we'll
	render uninitialized data.


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-09-17 08:56:52 UTC (rev 13835)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-09-17 11:10:11 UTC (rev 13836)
@@ -1,3 +1,9 @@
+2007-09-17  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/sapwood-render.c (theme_pixbuf_render): Ensure there's a mask
+	available also when centering pixmaps with masks. Otherwise we'll
+	render uninitialized data.
+
 2007-09-14  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
         * src/sapwood-render.c (theme_pixbuf_check_borders,

Modified: projects/haf/trunk/sapwood/src/sapwood-render.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-render.c	2007-09-17 08:56:52 UTC (rev 13835)
+++ projects/haf/trunk/sapwood/src/sapwood-render.c	2007-09-17 11:10:11 UTC (rev 13836)
@@ -427,10 +427,25 @@
       rect[0].dest.width = pixbuf_width;
       rect[0].dest.height = pixbuf_height;
 
+      /* need to ensure mask is available if the pixmap has one */
+      mask_x = x;
+      mask_y = y;
+      if (rect[0].pixmask && !mask)
+	{
+	  mask = gdk_pixmap_new (NULL, pixbuf_width, pixbuf_height, 1);
+	  mask_x = 0;
+	  mask_y = 0;
+	}
+      else if (mask)
+	g_object_ref (mask);
+
       sapwood_pixmap_render_rects (pixmap,
                                    window, x, y, draw_width, draw_height,
-                                   mask, x, y, FALSE,
+                                   mask, mask_x, mask_y, FALSE,
                                    clip_rect, 1, rect);
+
+      if (mask)
+	g_object_unref (mask);
     }
   else /* tile? */
     {


More information about the maemo-commits mailing list