From 08aa2c9297430580fd6bd5c270b9db40b6fde34d Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 12 Mar 2015 00:43:29 +0400 Subject: [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 --- src/gui/text/qfontengine_ft.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/gui/text/qfontengine_ft.cpp') 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; } -- cgit v1.2.3