[GRASS-SVN] r40501 - grass/trunk/lib/cairodriver
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 17 08:34:10 EST 2010
Author: glynn
Date: 2010-01-17 08:34:10 -0500 (Sun, 17 Jan 2010)
New Revision: 40501
Modified:
grass/trunk/lib/cairodriver/Raster.c
Log:
Fix drawing transparent cells over opaque cells
(cairo uses pre-multiplied alpha)
Modified: grass/trunk/lib/cairodriver/Raster.c
===================================================================
--- grass/trunk/lib/cairodriver/Raster.c 2010-01-17 13:33:19 UTC (rev 40500)
+++ grass/trunk/lib/cairodriver/Raster.c 2010-01-17 13:34:10 UTC (rev 40501)
@@ -91,13 +91,16 @@
G_debug(3, "Cairo_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