diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-18 09:07:33 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-19 08:42:21 (GMT) |
commit | db17ebe4510371b3b007c3852f2d1110abefbdda (patch) | |
tree | 1a04962269c03c194d490e760e69be0a36c95de4 | |
parent | e074334240d3901e28d4e8a6f28aa7da9481a72b (diff) | |
download | Qt-db17ebe4510371b3b007c3852f2d1110abefbdda.zip Qt-db17ebe4510371b3b007c3852f2d1110abefbdda.tar.gz Qt-db17ebe4510371b3b007c3852f2d1110abefbdda.tar.bz2 |
Skip shaping for hidden line/paragraph separators
Since we are not going to draw them in QTextLine::draw either,
and shaping them here will cause performance issue on certain
systems like Mac OS X 10.7 (most fonts don't have glyph for U+2028,
while font fallback handling in Core Text slowed down a bit).
Task-number: QTBUG-20252
Reviewed-by: Eskil
-rw-r--r-- | src/gui/text/qtextengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index d92c418..dd93cae 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -897,6 +897,12 @@ void QTextEngine::shapeText(int item) const if (si.num_glyphs) return; + // Skip shaping of line or paragraph separators since we are not + // going to draw them anyway + if (si.analysis.flags == QScriptAnalysis::LineOrParagraphSeparator + && !(option.flags() & QTextOption::ShowLineAndParagraphSeparators)) + return; + #if defined(Q_WS_MAC) #if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) if (enableHarfBuzz()) { |