summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-02-24 21:32:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-02-27 12:02:08 +0000
commit8a58579a35bb275c985ff0fd412c92f10cd8a085 (patch)
tree2916a1b7ef173cfe5958c78fd173e9c8b2e78a14 /vcl
parent005ee4fc396b998a34fb5a9e03e9e6ef4e46cc34 (diff)
tdf#89666: vcl: speed up HbLayoutEngine line layout for large paragraphs
When formatting a 180k char Writer paragraph, most of the time is spent in vcl::ScriptRun::next(), which is called twice per line from SwTxtGuess::Guess(), once via GetTxtBreak() and once via GetTxtSize(). In the second call, from GetTxtSize(), the end position of the line is known, and passed to vcl, and iterating beyond that position seems pointless. This reduces vcl::ScriptRun::next() from 24 to 11 billion callgrind cycles when built with GCC 4.9.2 -m32 -Os. Change-Id: Ia23fcccaf5ef9c9ecdcb54bfc8f0f8a043c8711e (cherry picked from commit 7fde44c85620f8079bc4863fe3f7ea1f69a0f88c) Reviewed-on: https://gerrit.libreoffice.org/14646 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index abd04baf41cf..f7523a153b37 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -372,7 +372,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
rLayout.Reserve(nGlyphCapacity);
- vcl::ScriptRun aScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnLength);
+ vcl::ScriptRun aScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnEndCharPos);
Point aCurrPos(0, 0);
while (true)