pango r2794 - in trunk: . pango



Author: behdad
Date: Thu Jan  8 01:33:23 2009
New Revision: 2794
URL: http://svn.gnome.org/viewvc/pango?rev=2794&view=rev

Log:
2009-01-07  Behdad Esfahbod  <behdad gnome org>

        Bug 566726 â Minor optimization

        * pango/pango-context.c (get_shaper_and_font):
        Don't walk the fontset if there are no engines.

Modified:
   trunk/ChangeLog
   trunk/pango/pango-context.c

Modified: trunk/pango/pango-context.c
==============================================================================
--- trunk/pango/pango-context.c	(original)
+++ trunk/pango/pango-context.c	Thu Jan  8 01:33:23 2009
@@ -1133,28 +1133,34 @@
   info.font = NULL;
 
   info.engines = state->exact_engines;
-  if (state->enable_fallback)
-    pango_fontset_foreach (state->current_fonts, get_shaper_and_font_foreach, &info);
-  else
-    get_shaper_and_font_foreach (NULL, get_base_font (state), &info);
-
-  if (info.shape_engine)
+  if (info.engines)
     {
-      *shape_engine = info.shape_engine;
-      *font = info.font;
-
-      /* skip caching if fallback disabled (see above) */
       if (state->enable_fallback)
-	shaper_font_cache_insert (state->cache, wc, *shape_engine, *font);
+	pango_fontset_foreach (state->current_fonts, get_shaper_and_font_foreach, &info);
+      else
+	get_shaper_and_font_foreach (NULL, get_base_font (state), &info);
+
+      if (info.shape_engine)
+	{
+	  *shape_engine = info.shape_engine;
+	  *font = info.font;
+
+	  /* skip caching if fallback disabled (see above) */
+	  if (state->enable_fallback)
+	    shaper_font_cache_insert (state->cache, wc, *shape_engine, *font);
 
-      return TRUE;
+	  return TRUE;
+	}
     }
 
   info.engines = state->fallback_engines;
-  if (state->enable_fallback)
-    pango_fontset_foreach (state->current_fonts, get_shaper_and_font_foreach, &info);
-  else
-    get_shaper_and_font_foreach (NULL, get_base_font (state), &info);
+  if (info.engines)
+    {
+      if (state->enable_fallback)
+	pango_fontset_foreach (state->current_fonts, get_shaper_and_font_foreach, &info);
+      else
+	get_shaper_and_font_foreach (NULL, get_base_font (state), &info);
+    }
 
   *shape_engine = info.shape_engine;
   *font = info.font;



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