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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 3 15:46:08 EEST 2007
Author: tko
Date: 2007-07-03 15:45:52 +0300 (Tue, 03 Jul 2007)
New Revision: 12623

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-render.c
Log:
When clamping the mask to clip mask, do not change the area to paint.

2007-07-03  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/sapwood-render.c (theme_pixbuf_render): When clamping the mask
	to clip mask, do not change the area to paint.


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-07-03 12:01:18 UTC (rev 12622)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-07-03 12:45:52 UTC (rev 12623)
@@ -1,3 +1,8 @@
+2007-07-03  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/sapwood-render.c (theme_pixbuf_render): When clamping the mask
+	to clip mask, do not change the area to paint.
+
 2007-06-26  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
 	* src/sapwood-render.c (theme_pixbuf_render): Remove unused variables.

Modified: projects/haf/trunk/sapwood/src/sapwood-render.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-render.c	2007-07-03 12:01:18 UTC (rev 12622)
+++ projects/haf/trunk/sapwood/src/sapwood-render.c	2007-07-03 12:45:52 UTC (rev 12623)
@@ -308,8 +308,13 @@
 
       if (!mask)
         {
+	  gint mask_width;
+	  gint mask_height;
+
 	  mask_x = 0;
 	  mask_y = 0;
+	  mask_width = width;
+	  mask_height = height;
 	  mask_required = FALSE;
 
 	  if (clip_rect)
@@ -317,32 +322,32 @@
 	      /* limit the mask to clip_rect size to avoid allocating huge
 	       * pixmaps and getting BadAlloc from X
 	       */
-	      if (clip_rect->width < width)
+	      if (clip_rect->width < mask_width)
 		{
-		  LOG("width: %d -> %d", width, clip_rect->width);
-		  x      = clip_rect->x;
-		  width  = clip_rect->width;
+		  LOG("width: %d -> %d", mask_width, clip_rect->width);
+		  mask_x = clip_rect->x;
+		  mask_width = clip_rect->width;
 		}
 	      if (clip_rect->height < height)
 		{
-		  LOG("height: %d -> %d", height, clip_rect->height);
-		  y      = clip_rect->y;
-		  height = clip_rect->height;
+		  LOG("height: %d -> %d", mask_height, clip_rect->height);
+		  mask_y = clip_rect->y;
+		  mask_height = clip_rect->height;
 		}
 	    }
 
 	  gdk_error_trap_push ();
 
-	  mask = gdk_pixmap_new (NULL, width, height, 1);
+	  mask = gdk_pixmap_new (NULL, mask_width, mask_height, 1);
 
 	  /* gdk_flush (); */
 	  if (gdk_error_trap_pop ())
 	    {
 	      if (clip_rect)
 		g_warning ("theme_pixbuf_render(clip_rect={x: %d,y: %d, width: %d, height: %d}: gdk_pixmap_new(width: %d, height: %d) failed",
-			   clip_rect->x, clip_rect->y, clip_rect->width, clip_rect->height, width, height);
+			   clip_rect->x, clip_rect->y, clip_rect->width, clip_rect->height, mask_width, mask_height);
 	      else
-		g_warning ("theme_pixbuf_render(clip_rect=(null)}: gdk_pixmap_new(width: %d, height: %d) failed", width, height);
+		g_warning ("theme_pixbuf_render(clip_rect=(null)}: gdk_pixmap_new(width: %d, height: %d) failed", mask_width, mask_height);
 
 	      /* pretend that we drew things successfully, there should be a
 	       * new paint call coming to allow us to paint the thing properly


More information about the maemo-commits mailing list