summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-02-24 21:32:54 +0100
committerAndras Timar <andras.timar@collabora.com>2015-03-04 03:13:46 -0800
commit44b0389cc14891285856971709ef0eaf8a25bcd4 (patch)
tree3307153452d2a0ccfac316861d51921bffca77a6 /vcl
parent8e9c0cfe86b0e6570c41ad625e1e59d289b4015e (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. (cherry picked from commit 7fde44c85620f8079bc4863fe3f7ea1f69a0f88c) Conflicts: vcl/generic/glyphs/gcach_layout.cxx Change-Id: Ia23fcccaf5ef9c9ecdcb54bfc8f0f8a043c8711e Reviewed-on: https://gerrit.libreoffice.org/14645 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 623f16d7a47020600e2b4ba03aa6a617545b0d93)
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 3f065bb0ee1d..bf2eab2c4bbb 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);
- ScriptRun aScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnLength);
+ ScriptRun aScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnEndCharPos);
Point aCurrPos(0, 0);
while (true)