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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Aug 23 17:45:47 EEST 2007
Author: tko
Date: 2007-08-23 17:45:45 +0300 (Thu, 23 Aug 2007)
New Revision: 13382

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-pixmap.c
Log:
handle mask == NULL without generating warnings

2007-08-23  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/sapwood-pixmap.c (sapwood_pixmap_render_rects_internal): handle
	mask == NULL without generating warnings


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-08-23 14:45:43 UTC (rev 13381)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-08-23 14:45:45 UTC (rev 13382)
@@ -1,5 +1,10 @@
 2007-08-23  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
+	* src/sapwood-pixmap.c (sapwood_pixmap_render_rects_internal): handle
+	mask == NULL without generating warnings
+
+2007-08-23  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
 	* src/sapwood-render.c (theme_pixbuf_render): When limiting the mask
 	to (smaller) clip rectangle, calculate the mask offset correctly.
 

Modified: projects/haf/trunk/sapwood/src/sapwood-pixmap.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-pixmap.c	2007-08-23 14:45:43 UTC (rev 13381)
+++ projects/haf/trunk/sapwood/src/sapwood-pixmap.c	2007-08-23 14:45:45 UTC (rev 13382)
@@ -324,39 +324,41 @@
   xofs = draw_x - mask_x;
   yofs = draw_y - mask_y;
 
-  if (!mask_gc)
+  if (mask)
     {
-      values.fill = GDK_TILED;
-      mask_gc = gdk_gc_new_with_values (mask, &values, GDK_GC_FILL);
-    }
-
-  for (n = 0; n < n_rect; n++)
-    {
-      /* const */ GdkRectangle *dest = &rect[n].dest;
-      GdkRectangle              area;
-
-      if (!mask_required && clip_rect)
+      if (!mask_gc)
 	{
-	  if (!gdk_rectangle_intersect (dest, clip_rect, &area))
-	    continue;
-	}	  
-      else
-	area = *dest;
+	  values.fill = GDK_TILED;
+	  mask_gc = gdk_gc_new_with_values (mask, &values, GDK_GC_FILL);
+	}
 
-      if (rect[n].pixmap && rect[n].pixmask)
+      for (n = 0; n < n_rect; n++)
 	{
-	  values.tile = rect[n].pixmask;
-	  values.ts_x_origin = dest->x - xofs;
-	  values.ts_y_origin = dest->y - yofs;
-	  gdk_gc_set_values (mask_gc, &values, GDK_GC_TILE|GDK_GC_TS_X_ORIGIN|GDK_GC_TS_Y_ORIGIN);
+	  /* const */ GdkRectangle *dest = &rect[n].dest;
+	  GdkRectangle              area;
 
-	  gdk_draw_rectangle (mask, mask_gc, TRUE, area.x - xofs, area.y - yofs, area.width, area.height);
+	  if (!mask_required && clip_rect)
+	    {
+	      if (!gdk_rectangle_intersect (dest, clip_rect, &area))
+		continue;
+	    }	  
+	  else
+	    area = *dest;
 
-	  have_mask = TRUE;
+	  if (rect[n].pixmap && rect[n].pixmask)
+	    {
+	      values.tile = rect[n].pixmask;
+	      values.ts_x_origin = dest->x - xofs;
+	      values.ts_y_origin = dest->y - yofs;
+	      gdk_gc_set_values (mask_gc, &values, GDK_GC_TILE|GDK_GC_TS_X_ORIGIN|GDK_GC_TS_Y_ORIGIN);
+
+	      gdk_draw_rectangle (mask, mask_gc, TRUE, area.x - xofs, area.y - yofs, area.width, area.height);
+
+	      have_mask = TRUE;
+	    }
 	}
     }
 
-
   if (!draw_gc)
     {
       values.fill = GDK_TILED;


More information about the maemo-commits mailing list