diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-03-03 15:26:10 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-03-31 20:08:35 +0200 |
commit | b9782a2b59428e1bc398b5f3a895785a072c93b6 (patch) | |
tree | 11321664d97646020fb77cf161e89e20a11d68d6 /svx/inc/sxraitm.hxx | |
parent | b7fa07b07195799f385ccba0243611f71ffe0525 (diff) |
tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().
This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.
There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).
Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.
This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).
Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/inc/sxraitm.hxx')
0 files changed, 0 insertions, 0 deletions