diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2010-08-25 14:40:32 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2010-09-10 10:25:17 (GMT) |
commit | a9bf68d69d30fc44264f09a75f5e33431bdf4616 (patch) | |
tree | deaac1fab1c2b5f3ac158ba607f274e394a2fba2 /src/gui/text | |
parent | 27980c28ff76bb85f9f3ef244e272d65d6af6b45 (diff) | |
download | Qt-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/gui/text')
-rw-r--r-- | src/gui/text/qfontengine_win.cpp | 3 |
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 |