aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-01-25 16:03:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 15:11:28 +0000
commit5a907a7cce9a5ca72357f06e7874136d12b867b8 (patch)
tree93fddcbcc02be34c26ec9b6f4e7686edd9a2ec61
parenta56c4d267a877d208311a5326d134824ec987db3 (diff)
Fix SkShaper_harfbuzz bidi and non-bmp.
The mismatch between utf8, 16, and 32 and ubudi always wanting to think in terms of utf16 causes unhappiness. Change-Id: I375aa61810e344f3b92cba4780c2262d9a878272 Reviewed-on: https://skia-review.googlesource.com/99922 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
-rw-r--r--tools/shape/SkShaper_harfbuzz.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/shape/SkShaper_harfbuzz.cpp b/tools/shape/SkShaper_harfbuzz.cpp
index 6315a96a02..c5f437ea22 100644
--- a/tools/shape/SkShaper_harfbuzz.cpp
+++ b/tools/shape/SkShaper_harfbuzz.cpp
@@ -134,16 +134,16 @@ public:
SkASSERT(fUTF16LogicalPosition < ubidi_getLength(fBidi.get()));
int32_t endPosition = ubidi_getLength(fBidi.get());
fLevel = ubidi_getLevelAt(fBidi.get(), fUTF16LogicalPosition);
- ++fUTF16LogicalPosition;
- SkUTF8_NextUnichar(&fEndOfCurrentRun);
+ SkUnichar u = SkUTF8_NextUnichar(&fEndOfCurrentRun);
+ fUTF16LogicalPosition += SkUTF16_FromUnichar(u);
UBiDiLevel level;
while (fUTF16LogicalPosition < endPosition) {
level = ubidi_getLevelAt(fBidi.get(), fUTF16LogicalPosition);
if (level != fLevel) {
break;
}
- ++fUTF16LogicalPosition;
- SkUTF8_NextUnichar(&fEndOfCurrentRun);
+ u = SkUTF8_NextUnichar(&fEndOfCurrentRun);
+ fUTF16LogicalPosition += SkUTF16_FromUnichar(u);
}
}
const char* endOfCurrentRun() const override {