From a44da8fc12bdd1fc62311307b7cae391858a206e Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 6 Mar 2012 16:42:03 +0100 Subject: [PATCH] Remove dead code. This logic was introduced as part of change I92dfb39289a359f49caa02c2caf8baf66098fb59 but isn't used anymore. Change-Id: I5bcfea99a7a2993434e1e978195a70dae52d6cfa Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont.cpp | 14 -------------- src/gui/text/qfont_p.h | 1 - src/gui/text/qfontengine.cpp | 16 ---------------- src/gui/text/qfontengine_p.h | 1 - 4 files changed, 32 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index c68452d55a..56ff298d9b 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -2733,20 +2733,6 @@ void QFontCache::updateHitCountAndTimeStamp(Engine &value) value.data->name()); } -void QFontCache::removeEngine(QFontEngine *engine) -{ - EngineCache::iterator it = engineCache.begin(); - while (it != engineCache.end()) { - if (it.value().data == engine) { - it = engineCache.erase(it); - if (--engine->cache_count == 0) - decreaseCost(engine->cache_cost); - } else { - ++it; - } - } -} - void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti) { FC_DEBUG("QFontCache: inserting new engine %p", engine); diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index 06cf787880..13e5fcbedd 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -245,7 +245,6 @@ public: void updateHitCountAndTimeStamp(Engine &value); void insertEngine(const Key &key, QFontEngine *engine, bool insertMulti = false); - void removeEngine(QFontEngine *engine); private: void increaseCost(uint cost); diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 142d627100..53c5f9fc31 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1421,22 +1421,6 @@ bool QFontEngineMulti::shouldLoadFontEngineForCharacter(int at, uint ucs4) const return true; } -void QFontEngineMulti::unloadEngine(int at) -{ - QFontEngine *fontEngine = engines.at(at); - if (fontEngine == 0) - return; - - // If there are other references to the engine, keep it around and keep the reference - if (fontEngine->ref.load() == 1) { - QFontCache::instance()->removeEngine(fontEngine); - if (fontEngine->cache_count == 0) { - delete fontEngine; - engines[at] = 0; - } - } -} - glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs) { if (glyphs.numGlyphs <= 0) diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 660e3be459..b4436426b2 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -401,7 +401,6 @@ protected: friend class QPSPrintEngineFontMulti; friend class QRawFont; virtual void loadEngine(int at) = 0; - virtual void unloadEngine(int at); QVector engines; };