diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-11-30 19:29:37 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-11-30 19:29:37 +0000 |
commit | 342fa3e8764497bb3794cbd40d054a7ab7b58024 (patch) | |
tree | da185398335d91e79646a312ed7e2101878504a4 /pango/pango-renderer.c | |
parent | c36764c2ca8c986fc124bdf546c3e88ae6badfc0 (diff) | |
download | pango-342fa3e8764497bb3794cbd40d054a7ab7b58024.tar.gz |
Don't call into pango_glyph_string_extents() if we don't need anything out
2006-11-30 Behdad Esfahbod <behdad@gnome.org>
* pango/pango-renderer.c (pango_renderer_draw_layout_line):
Don't call into pango_glyph_string_extents() if we don't need anything
out of it! (Ok, that function returns immediately in that case, but
still, avoiding the call overhead.)
Diffstat (limited to 'pango/pango-renderer.c')
-rw-r--r-- | pango/pango-renderer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index 02ee4e38..af056a19 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -503,8 +503,9 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer, ink = &ink_rect; logical = &logical_rect; } - pango_glyph_string_extents (run->glyphs, run->item->analysis.font, - ink, logical); + if (G_UNLIKELY (ink || logical)) + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, + ink, logical); if (logical) glyph_string_width = logical_rect.width; else |