diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-30 09:35:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-12-30 09:35:39 +0100 |
commit | 4295203dd67a4c4d0aa0fe1a8b116069542e4474 (patch) | |
tree | a3b2b1e074b7b0838b89b224506fab6818c61acc /src/gui/text | |
parent | 8f0e84bec513ad28c3ec479053fbc59add3959e1 (diff) | |
parent | aaff94c2df665035addb90714bab4722003894da (diff) |
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 30 | ||||
-rw-r--r-- | src/gui/text/qfontengine_ft_p.h | 3 | ||||
-rw-r--r-- | src/gui/text/qrawfont_p.h | 15 |
3 files changed, 14 insertions, 34 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 3549f57d3d..e0c1b46a90 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1377,36 +1377,6 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadTransformedGlyphSet(const QTransfor return gs; } -bool QFontEngineFT::loadGlyphs(QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs, - const QFixedPoint *positions, - GlyphFormat format) -{ - FT_Face face = 0; - - for (int i = 0; i < num_glyphs; ++i) { - QFixed spp = subPixelPositionForX(positions[i].x); - Glyph *glyph = gs ? gs->getGlyph(glyphs[i], spp) : 0; - if (glyph == 0 || glyph->format != format) { - if (!face) { - face = lockFace(); - FT_Matrix m = matrix; - FT_Matrix_Multiply(&gs->transformationMatrix, &m); - FT_Set_Transform(face, &m, 0); - freetype->matrix = m; - } - if (!loadGlyph(gs, glyphs[i], spp, format)) { - unlockFace(); - return false; - } - } - } - - if (face) - unlockFace(); - - return true; -} - void QFontEngineFT::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) { FT_Face face = lockFace(Unscaled); diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 02c692cccc..e33f0fc0f5 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -269,9 +269,6 @@ private: Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t); QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix); - bool loadGlyphs(QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs, - const QFixedPoint *positions, - GlyphFormat format = Format_Render); QFontEngineFT(const QFontDef &fd); virtual ~QFontEngineFT(); diff --git a/src/gui/text/qrawfont_p.h b/src/gui/text/qrawfont_p.h index 9b0846de9a..96ba3fd026 100644 --- a/src/gui/text/qrawfont_p.h +++ b/src/gui/text/qrawfont_p.h @@ -70,14 +70,18 @@ public: , hintingPreference(other.hintingPreference) , thread(other.thread) { +#ifndef QT_NO_DEBUG Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread()); +#endif if (fontEngine != 0) fontEngine->ref.ref(); } ~QRawFontPrivate() { +#ifndef QT_NO_DEBUG Q_ASSERT(ref.load() == 0); +#endif cleanUp(); } @@ -89,27 +93,36 @@ public: inline bool isValid() const { +#ifndef QT_NO_DEBUG Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread()); +#endif return fontEngine != 0; } inline void setFontEngine(QFontEngine *engine) { +#ifndef QT_NO_DEBUG Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread()); +#endif if (fontEngine == engine) return; if (fontEngine != 0) { if (!fontEngine->ref.deref()) delete fontEngine; +#ifndef QT_NO_DEBUG thread = 0; +#endif } fontEngine = engine; if (fontEngine != 0) { fontEngine->ref.ref(); - Q_ASSERT(thread = QThread::currentThread()); // set only if assertions enabled +#ifndef QT_NO_DEBUG + thread = QThread::currentThread(); + Q_ASSERT(thread); +#endif } } |