vte r2221 - in trunk: . src



Author: behdad
Date: Sat Nov 29 00:41:18 2008
New Revision: 2221
URL: http://svn.gnome.org/viewvc/vte?rev=2221&view=rev

Log:
2008-11-28  Behdad Esfahbod  <behdad gnome org>

        * src/debug.c (_vte_debug_init):
        * src/debug.h:
        * src/vtepangocairo.c (font_info_cache_ascii),
        (font_info_allocate), (font_info_free),
        (font_info_find_for_context), (font_info_get_unichar_info):
        Port vtepangocairo profiling and lifecycle logging to vtedebug
        facilities under debug domain "pangocairo".



Modified:
   trunk/ChangeLog
   trunk/src/debug.c
   trunk/src/debug.h
   trunk/src/vtepangocairo.c

Modified: trunk/src/debug.c
==============================================================================
--- trunk/src/debug.c	(original)
+++ trunk/src/debug.c	Sat Nov 29 00:41:18 2008
@@ -47,7 +47,8 @@
     { "cells",        VTE_DEBUG_CELLS        },
     { "timeout",      VTE_DEBUG_TIMEOUT      },
     { "draw",         VTE_DEBUG_DRAW         },
-    { "ally",         VTE_DEBUG_ALLY         }
+    { "ally",         VTE_DEBUG_ALLY         },
+    { "pangocairo",   VTE_DEBUG_PANGOCAIRO   }
   };
 
   _vte_debug_flags = g_parse_debug_string (g_getenv("VTE_DEBUG"),

Modified: trunk/src/debug.h
==============================================================================
--- trunk/src/debug.h	(original)
+++ trunk/src/debug.h	Sat Nov 29 00:41:18 2008
@@ -46,7 +46,8 @@
 	VTE_DEBUG_TIMEOUT	= 1 << 16,
 	VTE_DEBUG_DRAW		= 1 << 17,
 	VTE_DEBUG_ALLY		= 1 << 18,
-	VTE_DEBUG_ADJ		= 1 << 19
+	VTE_DEBUG_ADJ		= 1 << 19,
+	VTE_DEBUG_PANGOCAIRO    = 1 << 20
 } VteDebugFlags;
 
 void _vte_debug_init(void);

Modified: trunk/src/vtepangocairo.c
==============================================================================
--- trunk/src/vtepangocairo.c	(original)
+++ trunk/src/vtepangocairo.c	Sat Nov 29 00:41:18 2008
@@ -120,8 +120,6 @@
 
 
 
-#undef VTEPANGOCAIRO_PROFILE
-
 #define FONT_CACHE_TIMEOUT (30) /* seconds */
 
 
@@ -232,7 +230,7 @@
 	/* cell metrics */
 	gint width, height, ascent;
 
-#ifdef VTEPANGOCAIRO_PROFILE
+#ifdef VTE_DEBUG
 	/* profiling info */
 	int coverage_count[4];
 #endif
@@ -341,16 +339,16 @@
 		ufi->using_cairo_glyph.scaled_font = cairo_scaled_font_reference (scaled_font);
 		ufi->using_cairo_glyph.glyph_index = glyph;
 
-#ifdef VTEPANGOCAIRO_PROFILE
+#ifdef VTE_DEBUG
 		info->coverage_count[0]++;
 		info->coverage_count[uinfo->coverage]++;
 #endif
 	}
 
-#ifdef VTEPANGOCAIRO_PROFILE
-	g_message ("vtepangocairo: %p cached %d ASCII letters",
-		   info,
-		   info->coverage_count[0]);
+#ifdef VTE_DEBUG
+	_vte_debug_print (VTE_DEBUG_PANGOCAIRO,
+			  "vtepangocairo: %p cached %d ASCII letters\n",
+			  info, info->coverage_count[0]);
 #endif
 }
 
@@ -402,8 +400,8 @@
 	}
 
 	_vte_debug_print (VTE_DEBUG_MISC,
-			  "VtePangoCairo font metrics = %dx%d (%d).\n",
-			  info->width, info->height, info->ascent);
+			  "vtepangocairo: %p font metrics = %dx%d (%d)\n",
+			  info, info->width, info->height, info->ascent);
 }
 
 
@@ -414,10 +412,9 @@
 
 	info = g_slice_new0 (struct font_info);
 
-#ifdef VTEPANGOCAIRO_PROFILE
-	g_message ("vtepangocairo: %p allocating font_info",
-		   info);
-#endif
+	_vte_debug_print (VTE_DEBUG_PANGOCAIRO,
+			  "vtepangocairo: %p allocating font_info\n",
+			  info);
 
 	info->layout = pango_layout_new (context);
 
@@ -431,13 +428,14 @@
 {
 	gunichar i;
 
-#ifdef VTEPANGOCAIRO_PROFILE
-	g_message ("vtepangocairo: %p freeing font_info.  coverages %d = %d + %d + %d",
-		   info,
-		   info->coverage_count[0],
-		   info->coverage_count[1],
-		   info->coverage_count[2],
-		   info->coverage_count[3]);
+#ifdef VTE_DEBUG
+	_vte_debug_print (VTE_DEBUG_PANGOCAIRO,
+			  "vtepangocairo: %p freeing font_info.  coverages %d = %d + %d + %d\n",
+			  info,
+			  info->coverage_count[0],
+			  info->coverage_count[1],
+			  info->coverage_count[2],
+			  info->coverage_count[3]);
 #endif
 
 	g_object_unref (info->layout);
@@ -588,10 +586,9 @@
 
 	info = g_hash_table_lookup (font_info_for_context, context);
 	if (G_LIKELY (info)) {
-#ifdef VTEPANGOCAIRO_PROFILE
-		g_message ("vtepangocairo: %p found font_info in cache",
-			   info);
-#endif
+		_vte_debug_print (VTE_DEBUG_PANGOCAIRO,
+				  "vtepangocairo: %p found font_info in cache\n",
+				  info);
 		return font_info_reference (info);
 	}
 
@@ -746,10 +743,11 @@
 	/* release internal layout resources */
 	pango_layout_set_text (info->layout, "", -1);
 
-#ifdef VTEPANGOCAIRO_PROFILE
+#ifdef VTE_DEBUG
 	info->coverage_count[0]++;
 	info->coverage_count[uinfo->coverage]++;
 #endif
+
 	return uinfo;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]