diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-06-05 14:59:17 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-07-30 12:31:51 (GMT) |
commit | 9939ce88427b4d33f50b45a0da85266f9ee37927 (patch) | |
tree | 01dd7b342320a11a2984f6495a202b0be1e63372 /src/gui/text/qfontengine_ft.cpp | |
parent | 2fb1b5378e551a42554b42c028226e65b3b41593 (diff) | |
download | Qt-9939ce88427b4d33f50b45a0da85266f9ee37927.zip Qt-9939ce88427b4d33f50b45a0da85266f9ee37927.tar.gz Qt-9939ce88427b4d33f50b45a0da85266f9ee37927.tar.bz2 |
Don't do two hash lookups in loadGlyphs()
loadGlyphs() has a big impact on text rendering speed on X11. Removing
the uneeded hash lookup makes this function go twice as fast, as it in
the common case (where the glyphs are already cached) the hash lookups are
100% of the running time of the function.
Reviewed-by: Trond
Diffstat (limited to 'src/gui/text/qfontengine_ft.cpp')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index a0b6f0c..d210cb4 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1378,8 +1378,8 @@ bool QFontEngineFT::loadGlyphs(QGlyphSet *gs, glyph_t *glyphs, int num_glyphs, G FT_Face face = 0; for (int i = 0; i < num_glyphs; ++i) { - if (!gs->glyph_data.contains(glyphs[i]) - || gs->glyph_data.value(glyphs[i])->format != format) { + Glyph *glyph = gs->glyph_data.value(glyphs[i]); + if (glyph == 0 || glyph->format != format) { if (!face) { face = lockFace(); FT_Matrix m = matrix; |