diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-12 00:43:29 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-12 07:42:32 +0000 |
commit | 08aa2c9297430580fd6bd5c270b9db40b6fde34d (patch) | |
tree | f60f476e432af85c8c7eba41182f17f7f535888b | |
parent | 066daf750fcffff8eeae4d5749607501b9aa9a2f (diff) |
[QFontEngineFT] Move some code around to improve readability
And avoid conversion when the cached FT transform could be used.
Change-Id: I9f6bf0a6c6fa166092de698f3ddbbf203e2b3820
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 86fff271af..decf17075f 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1843,9 +1843,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g, const QTransform &t, bool fetchBoundingBox) { - FT_Face face = 0; QGlyphSet *glyphSet = 0; - FT_Matrix ftMatrix = QTransformToFTMatrix(t); if (cacheEnabled) { if (t.type() > QTransform::TxTranslate && FT_IS_SCALABLE(freetype->face)) glyphSet = loadTransformedGlyphSet(t); @@ -1859,15 +1857,14 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g, Glyph *glyph = glyphSet != 0 ? glyphSet->getGlyph(g, subPixelPosition) : 0; if (!glyph || glyph->format != format) { - face = lockFace(); + lockFace(); FT_Matrix m = this->matrix; + FT_Matrix ftMatrix = glyphSet != 0 ? glyphSet->transformationMatrix : QTransformToFTMatrix(t); FT_Matrix_Multiply(&ftMatrix, &m); freetype->matrix = m; glyph = loadGlyph(glyphSet, g, subPixelPosition, format, false); - } - - if (face) unlockFace(); + } return glyph; } |