diff options
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r-- | src/gui/text/qfont.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 828dbc318c..12631b3a73 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -76,7 +76,9 @@ QT_BEGIN_NAMESPACE - +#ifndef QFONTCACHE_DECREASE_TRIGGER_LIMIT +# define QFONTCACHE_DECREASE_TRIGGER_LIMIT 256 +#endif bool QFontDef::exactMatch(const QFontDef &other) const { @@ -2800,7 +2802,7 @@ void QFontCache::insertEngineData(const QFontDef &def, QFontEngineData *engineDa engineData->ref.ref(); // Decrease now rather than waiting - if (total_cost > min_cost * 2) + if (total_cost > min_cost * 2 && engineDataCache.size() >= QFONTCACHE_DECREASE_TRIGGER_LIMIT) decreaseCache(); engineDataCache.insert(def, engineData); @@ -2849,7 +2851,7 @@ void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMu #endif engine->ref.ref(); // Decrease now rather than waiting - if (total_cost > min_cost * 2) + if (total_cost > min_cost * 2 && engineCache.size() >= QFONTCACHE_DECREASE_TRIGGER_LIMIT) decreaseCache(); Engine data(engine); |