From 46b3a2401d371b20bdbfca6a47c09408259d595f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 16 Aug 2018 13:51:43 +0200 Subject: 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 Tested-by: Jenkins --- vcl/source/gdi/CommonSalLayout.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl/source/gdi/CommonSalLayout.cxx') 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); -- cgit