summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-18 11:07:33 +0200
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-19 10:42:21 +0200
commitdb17ebe4510371b3b007c3852f2d1110abefbdda (patch)
tree1a04962269c03c194d490e760e69be0a36c95de4 /src/gui/text/qtextengine.cpp
parente074334240d3901e28d4e8a6f28aa7da9481a72b (diff)
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
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index d92c418bf3..dd93cae1d7 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()) {