From 1acb774b2b11638ee40c8a96af659071926732f9 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 17 Dec 2014 11:19:46 -0200 Subject: Remove unused code from QFontEngineFT. This method is not being called anywhere. Change-Id: Ia32e8b48d324e4848db666de4d274a260d22b06d Reviewed-by: Konstantin Ritt Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft.cpp | 30 ------------------------------ src/gui/text/qfontengine_ft_p.h | 3 --- 2 files changed, 33 deletions(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 8b6c9a192c..792bfadb5e 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1410,36 +1410,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 5b397e0034..383902c784 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(); -- cgit v1.2.3 From ceeb032de6b9e9256f96ce033512529523ea64b1 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 22 Dec 2014 16:49:41 +0100 Subject: QRawFont: improve the thread-safety checks 384388f2 introduced some checks, and used an assignment in an assert; that sets off compiler warnings about expressions with side effects into an assertion. Hence, that code needs to be reworked a bit. Unfortunately, there's no single define we can use to know if assertions are enabled or not in Qt, so simply use QT_NO_DEBUG to enable/disable those checks. The actual "thread" data member is kept around to avoid break ABI depending on debugging flags. Change-Id: I8b07e7ff6f81359d6b0653a1d9cc2b720541d1b9 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qrawfont_p.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/gui/text') 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 } } -- cgit v1.2.3