diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-16 13:51:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-16 17:32:56 +0200 |
commit | 46b3a2401d371b20bdbfca6a47c09408259d595f (patch) | |
tree | f89d3f274688d66c8a92249de5130dfe2ee73ded /vcl/source/gdi/CommonSalLayout.cxx | |
parent | a518d1acf7f2f9952ab1d20f3185615351655ef8 (diff) |
vcl: support pre-computed glyph items in OutputDevice::ImplLayout()
This allows using the SalLayoutGlyphs obtained from
GenericSalLayout::GetGlyphs() to return early in
GenericSalLayout::LayoutText().
Change-Id: If3a004f983f3578915786668bfcada00227d2eeb
Reviewed-on: https://gerrit.libreoffice.org/59169
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'vcl/source/gdi/CommonSalLayout.cxx')
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 32d8e572156a..fc38b33437e1 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -263,12 +263,19 @@ bool GenericSalLayout::HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aVariationS return hb_set_has(mpVertGlyphs, nGlyphIndex) != 0; } -bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs) +bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs, const SalLayoutGlyphs* pGlyphs) { // No need to touch m_GlyphItems at all for an empty string. if (rArgs.mnEndCharPos - rArgs.mnMinCharPos <= 0) return true; + if (pGlyphs) + { + // Work with pre-computed glyph items. + m_GlyphItems = *pGlyphs; + return true; + } + hb_font_t *pHbFont = mpFont->GetHbFont(); hb_face_t* pHbFace = hb_font_get_face(pHbFont); |