diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-09-07 17:11:17 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-09-07 19:49:29 +0200 |
commit | 6323e6628668849438e6e19ba7ad2c6598263261 (patch) | |
tree | 5dadd77ee10cf85a2a5f94b2e5fbe5f94664d742 /vcl | |
parent | e75057a4d79d96464ff7ddd1511641b23757a502 (diff) |
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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/glyphs/gcach_layout.cxx | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx b/vcl/unx/generic/glyphs/gcach_layout.cxx index dc9a84f15345..d8bf44b04fbc 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) |