[Libreoffice-commits] core.git: vcl/unx
Khaled Hosny
khaledhosny at eglug.org
Wed Sep 7 17:50:15 UTC 2016
vcl/unx/generic/glyphs/gcach_layout.cxx | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
New commits:
commit 6323e6628668849438e6e19ba7ad2c6598263261
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Wed Sep 7 17:11:17 2016 +0200
Fix not-so-newly introduced perf regression in vcl
Reverts f688acfdae00ebdd891737e533d54368810185e1 and the cluster
boundaries part of 1da9b4c24e806ad2447b4a656e2a7192755bb6a8, checking
the user of the GlyphItem::IS_IN_CLUSTER flag again, I think the old
code provides what they expect.
Change-Id: I47d279837af963a6db74ebd0019dcef83d98ae7a
diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx b/vcl/unx/generic/glyphs/gcach_layout.cxx
index dc9a84f..d8bf44b 100644
--- a/vcl/unx/generic/glyphs/gcach_layout.cxx
+++ b/vcl/unx/generic/glyphs/gcach_layout.cxx
@@ -326,7 +326,6 @@ private:
hb_script_t maHbScript;
hb_face_t* mpHbFace;
int mnUnitsPerEM;
- css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
public:
explicit HbLayoutEngine(ServerFont&);
@@ -513,12 +512,6 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr);
hb_glyph_position_t *pHbPositions = hb_buffer_get_glyph_positions(pHbBuffer, nullptr);
- sal_Int32 nGraphemeStartPos = std::numeric_limits<sal_Int32>::max();
- sal_Int32 nGraphemeEndPos = std::numeric_limits<sal_Int32>::min();
- if (!mxBreak.is())
- mxBreak = vcl::unohelper::CreateBreakIterator();
- com::sun::star::lang::Locale aLocale(rArgs.maLanguageTag.getLocale());
-
for (int i = 0; i < nRunGlyphCount; ++i) {
int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint;
int32_t nCharPos = pHbGlyphInfos[i].cluster;
@@ -539,22 +532,8 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
nGlyphIndex = rFont.FixupGlyphIndex(nGlyphIndex, aChar);
bool bInCluster = false;
- if(bRightToLeft && (nCharPos < nGraphemeStartPos))
- {
- sal_Int32 nDone;
- nGraphemeStartPos = mxBreak->previousCharacters(rArgs.mrStr, nCharPos+1, aLocale,
- com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
- }
- else if(!bRightToLeft && (nCharPos >= nGraphemeEndPos))
- {
- sal_Int32 nDone;
- nGraphemeEndPos = mxBreak->nextCharacters(rArgs.mrStr, nCharPos, aLocale,
- com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
- }
- else
- {
+ if (i > 0 && pHbGlyphInfos[i].cluster == pHbGlyphInfos[i - 1].cluster)
bInCluster = true;
- }
long nGlyphFlags = 0;
if (bRightToLeft)
More information about the Libreoffice-commits
mailing list