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>
This commit is contained in:
Ben Wagner 2018-01-25 16:03:22 -05:00 committed by Skia Commit-Bot
parent a56c4d267a
commit 5a907a7cce

View File

@ -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 {