summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-04-30 17:16:17 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2013-05-01 20:18:44 +0200
commit84a8f817e174855ef72f0bafc734847690c5d736 (patch)
tree642e2287eda52d7c80584075dd01801c3f369d00 /vcl
parentdrop unintentionally duplicated lines (diff)
downloadcore-84a8f817e174855ef72f0bafc734847690c5d736.tar.gz
core-84a8f817e174855ef72f0bafc734847690c5d736.zip
[harfbuzz] Simplify cluster detection
Change-Id: I48c11fad175fe40f48baaa47238f6087b91e6a37
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 5fea884eb2c5..a849d9d29a69 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -474,11 +474,9 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, NULL);
hb_glyph_position_t *pHbPositions = hb_buffer_get_glyph_positions(pHbBuffer, NULL);
- int32_t nLastCluster = -1;
for (int i = 0; i < nRunGlyphCount; ++i) {
int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint;
- int32_t nCluster = pHbGlyphInfos[i].cluster;
- int32_t nCharPos = nCluster;
+ int32_t nCharPos = pHbGlyphInfos[i].cluster;
// if needed request glyph fallback by updating LayoutArgs
if (!nGlyphIndex)
@@ -500,16 +498,14 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
continue;
}
+ bool bInCluster = false;
+ if (i > 0 && pHbGlyphInfos[i].cluster == pHbGlyphInfos[i - 1].cluster)
+ bInCluster = true;
+
long nGlyphFlags = 0;
if (bRightToLeft)
nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- // what is this for?
- // XXX: rtl clusters
- bool bInCluster = false;
- if (nCluster == nLastCluster)
- bInCluster = true;
- nLastCluster = nCluster;
if (bInCluster)
nGlyphFlags |= GlyphItem::IS_IN_CLUSTER;