From db17ebe4510371b3b007c3852f2d1110abefbdda Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 18 Jul 2011 11:07:33 +0200 Subject: 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 --- src/gui/text/qtextengine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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()) { -- cgit v0.12