[GRASS-SVN] r44173 - grass/branches/releasebranch_6_4/lib/cairodriver

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 4 16:52:46 EDT 2010


Author: neteler
Date: 2010-11-04 13:52:46 -0700 (Thu, 04 Nov 2010)
New Revision: 44173

Modified:
   grass/branches/releasebranch_6_4/lib/cairodriver/Raster.c
Log:
glynn: Fix drawing transparent cells over opaque cells (backport from trunk, r40501)

Modified: grass/branches/releasebranch_6_4/lib/cairodriver/Raster.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/cairodriver/Raster.c	2010-11-02 14:53:55 UTC (rev 44172)
+++ grass/branches/releasebranch_6_4/lib/cairodriver/Raster.c	2010-11-04 20:52:46 UTC (rev 44173)
@@ -58,13 +58,16 @@
     G_debug(3, "Cairo_scaled_raster: %d %d", n, row);
 
     for (i = 0; i < n; i++) {
-	unsigned int r = red[i];
-	unsigned int g = grn[i];
-	unsigned int b = blu[i];
-	unsigned int a = (masked && nul && nul[i])
-	    ? 0x00 : 0xFF;
+	if (masked && nul && nul[i])
+	    *dst++ = 0;
+	else {
+	    unsigned int r = red[i];
+	    unsigned int g = grn[i];
+	    unsigned int b = blu[i];
+	    unsigned int a = 0xFF;
 
-	*dst++ = (a << 24) + (r << 16) + (g << 8) + (b << 0);
+	    *dst++ = (a << 24) + (r << 16) + (g << 8) + (b << 0);
+	}
     }
 
     return row + 1;



More information about the grass-commit mailing list