diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2012-04-16 13:36:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-17 16:28:46 +0200 |
commit | 46556529ecaa85b2e37c2be9a83a003ff92cfd7a (patch) | |
tree | 2a154fe4329cc9857efc232626f9da73c4db9977 /src/gui | |
parent | addffb71b45b5123ee449f0cfa4891dcab044a9f (diff) |
Fix a thread safety issue with QTextLine::glyphRuns
This is a very partial revert of 10ac80708.
Revert back to using engineFromScript, which is reentrant, for cases other
than the "rawfont mode". In that last case, reentrancy is not a big issue
so far as the only client is WebKit, and this is used in the web process,
with no threaded rendering.
Change-Id: I047b04cf0236d52e6d548f34cddd3dcc7c3c5f83
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index bec574bb83..94af3edeeb 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2288,7 +2288,13 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const iterator.getSelectionBounds(&x, &width); if (glyphLayout.numGlyphs > 0) { - QFontEngine *mainFontEngine = eng->fontEngine(si); + QFontEngine *mainFontEngine; +#ifndef QT_NO_RAWFONT + if (eng->useRawFont && eng->rawFont.isValid()) + mainFontEngine= eng->fontEngine(si); + else +#endif + mainFontEngine = font.d->engineForScript(si.analysis.script); if (mainFontEngine->type() == QFontEngine::Multi) { QFontEngineMulti *multiFontEngine = static_cast<QFontEngineMulti *>(mainFontEngine); |