Kaydet (Commit) 7fde44c8 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 88d4b2fb
...@@ -370,7 +370,7 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) ...@@ -370,7 +370,7 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
rLayout.Reserve(nGlyphCapacity); 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); Point aCurrPos(0, 0);
while (true) while (true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment