[GRASS-SVN] r63524 - grass/trunk/lib/cairodriver

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 13 06:55:42 PST 2014


Author: martinl
Date: 2014-12-13 06:55:42 -0800 (Sat, 13 Dec 2014)
New Revision: 63524

Modified:
   grass/trunk/lib/cairodriver/graph.c
Log:
cairodriver: add more debug messages

Modified: grass/trunk/lib/cairodriver/graph.c
===================================================================
--- grass/trunk/lib/cairodriver/graph.c	2014-12-13 14:50:46 UTC (rev 63523)
+++ grass/trunk/lib/cairodriver/graph.c	2014-12-13 14:55:42 UTC (rev 63524)
@@ -67,13 +67,16 @@
 	G_fatal_error(_("Unable to open display"));
 
     p = getenv("GRASS_RENDER_CAIRO_SCREEN");
-    if (!p || sscanf(p, "%i", &scrn) != 1)
+    if (!p || sscanf(p, "%i", &scrn) != 1) {
+        G_debug(1, "cairo: GRASS_RENDER_CAIRO_SCREEN=%s", p);
 	scrn = DefaultScreen(ca.dpy);
+    }
 
     p = getenv("GRASS_RENDER_CAIRO_VISUAL");
-    if (!p || sscanf(p, "%li", &xid) != 1)
+    if (!p || sscanf(p, "%li", &xid) != 1) {
+        G_debug(1, "cairo: GRASS_RENDER_CAIRO_VISUAL=%s", p);
 	xid = DefaultVisual(ca.dpy, scrn)->visualid;
-
+    }
     templ.visualid = xid;
     templ.screen = scrn;
 
@@ -124,7 +127,7 @@
     p = getenv("GRASS_RENDER_FILE");
     if (!p || strlen(p) == 0)
 	p = DEFAULT_FILE_NAME;
-    G_debug(1, "cairo: GRASS_RENDER_FILE: %s", p);
+    G_debug(1, "cairo: GRASS_RENDER_FILE=%s", p);
 
     ca.file_name = p;
 
@@ -155,7 +158,7 @@
 #endif
     else
 	G_fatal_error(_("Unknown file extension: %s"), p);
-    G_debug(1, "File type: %s (%d)", ca.file_name, ca.file_type);
+    G_debug(1, "cairo: file type=%d", ca.file_type);
 
     switch (ca.file_type) {
     case FTYPE_PDF:
@@ -170,9 +173,11 @@
 
     p = getenv("GRASS_RENDER_FILE_MAPPED");
     do_map = p && strcmp(p, "TRUE") == 0 && ends_with(ca.file_name, ".bmp");
-
+    G_debug(1, "cairo: GRASS_RENDER_FILE_MAPPED=%d", do_map);
+    
     p = getenv("GRASS_RENDER_FILE_READ");
     do_read = p && strcmp(p, "TRUE") == 0;
+    G_debug(1, "cairo: GRASS_RENDER_FILE_READ=%d", do_read);
 
     if (is_vector) {
 	do_read = do_map = 0;
@@ -234,7 +239,6 @@
     char *p;
 
     G_gisinit("Cairo driver");
-    G_debug(1, "Cairo_Graph_set");
 
     /* get background color */
     p = getenv("GRASS_RENDER_BACKGROUNDCOLOR");
@@ -249,6 +253,7 @@
 	}
 	else
 	    G_fatal_error("Unknown background color: %s", p);
+        G_debug(1, "cairo: GRASS_RENDER_BACKGROUNDCOLOR=%s", p);
     }
     else
 	ca.bgcolor_r = ca.bgcolor_g = ca.bgcolor_b = 1.0;
@@ -259,7 +264,8 @@
 	ca.bgcolor_a = 0.0;
     else
 	ca.bgcolor_a = 1.0;
-
+    G_debug(1, "cairo: GRASS_RENDER_TRANSPARENT=%s", p ? p : "FALSE");
+    
     antialias = CAIRO_ANTIALIAS_DEFAULT;
     p = getenv("GRASS_RENDER_ANTIALIAS");
     if (p && G_strcasecmp(p, "default") == 0)
@@ -270,7 +276,8 @@
 	antialias = CAIRO_ANTIALIAS_GRAY;
     if (p && G_strcasecmp(p, "subpixel") == 0)
 	antialias = CAIRO_ANTIALIAS_SUBPIXEL;
-
+    G_debug(1, "cairo: GRASS_RENDER_ANTIALIAS=%s", p ? p : "FALSE");
+    
     init_file();
 
     cairo_set_antialias(cairo, antialias);



More information about the grass-commit mailing list