summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-08-25 14:40:32 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-09-10 10:25:17 (GMT)
commita9bf68d69d30fc44264f09a75f5e33431bdf4616 (patch)
treedeaac1fab1c2b5f3ac158ba607f274e394a2fba2 /src
parent27980c28ff76bb85f9f3ef244e272d65d6af6b45 (diff)
downloadQt-a9bf68d69d30fc44264f09a75f5e33431bdf4616.zip
Qt-a9bf68d69d30fc44264f09a75f5e33431bdf4616.tar.gz
Qt-a9bf68d69d30fc44264f09a75f5e33431bdf4616.tar.bz2
Fix cache_cost initialization of QFontEngineMultiWin
Originally, QFontEngineMultiWin does not set its cache_cost according to the regular font engines it refers to, which makes cache management in QFontCache useless because cache_cost is always 0, and garbage collecting timerEvent can hardly be triggered. This patch solve part of the problem by using cache_cost of the first font engine for QFontEngineMultiWin. However, if a font engine is loaded by QFontEngineMulti::loadEngine, the cost is still not counted. Task-number: QTBUG-12562 Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfontengine_win.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index 82de0d5..ef1b504 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1296,6 +1296,7 @@ QFontEngineMultiWin::QFontEngineMultiWin(QFontEngineWin *first, const QStringLis
engines[0] = first;
first->ref.ref();
fontDef = engines[0]->fontDef;
+ cache_cost = first->cache_cost;
}
void QFontEngineMultiWin::loadEngine(int at)
@@ -1317,6 +1318,8 @@ void QFontEngineMultiWin::loadEngine(int at)
engines[at] = new QFontEngineWin(fam, hfont, stockFont, lf);
engines[at]->ref.ref();
engines[at]->fontDef = fontDef;
+
+ // TODO: increase cost in QFontCache for the font engine loaded here
}
QT_END_NAMESPACE