summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--pango/pango-context.c38
2 files changed, 29 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b81a39f..1d43b98c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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.
+
+2009-01-07 Behdad Esfahbod <behdad@gnome.org>
+
Bug 566941 – Add PANGO_ATTRIBUTE_INDEX_FROM_TEXT_BEGINNING and
PANGO_ATTRIBUTE_INDEX_TO_TEXT_END
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 4ede1ad4..95916ebe 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1133,28 +1133,34 @@ get_shaper_and_font (ItemizeState *state,
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);
- return TRUE;
+ 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;
+ }
}
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;