Remove static allocattion of UText
Bug: skia:11046
Change-Id: Iaad37b8f664b523b8a8b2a5e1aa895db40332d87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345038
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
diff --git a/modules/skshaper/src/SkUnicode_icu.cpp b/modules/skshaper/src/SkUnicode_icu.cpp
index 7636fdd..66185b6 100644
--- a/modules/skshaper/src/SkUnicode_icu.cpp
+++ b/modules/skshaper/src/SkUnicode_icu.cpp
@@ -140,9 +140,7 @@
bool setText(const char utftext8[], int utf8Units) override {
UErrorCode status = U_ZERO_ERROR;
-
- UText sUtf8UText = UTEXT_INITIALIZER;
- ICUUText text(utext_openUTF8(&sUtf8UText, &utftext8[0], utf8Units, &status));
+ ICUUText text(utext_openUTF8(nullptr, &utftext8[0], utf8Units, &status));
if (U_FAILURE(status)) {
SkDEBUGF("Break error: %s", u_errorName(status));
@@ -281,8 +279,7 @@
}
SkASSERT(iterator);
- UText sUtf16UText = UTEXT_INITIALIZER;
- ICUUText utf16UText(utext_openUChars(&sUtf16UText, (UChar*)utf16, utf16Units, &status));
+ ICUUText utf16UText(utext_openUChars(nullptr, (UChar*)utf16, utf16Units, &status));
if (U_FAILURE(status)) {
SkDEBUGF("Break error: %s", u_errorName(status));
return false;
@@ -308,8 +305,7 @@
(const char utf8[], int utf8Units, BreakType type, std::function<void(int, int)> setBreak) {
UErrorCode status = U_ZERO_ERROR;
- UText sUtf8UText = UTEXT_INITIALIZER;
- ICUUText text(utext_openUTF8(&sUtf8UText, &utf8[0], utf8Units, &status));
+ ICUUText text(utext_openUTF8(nullptr, &utf8[0], utf8Units, &status));
if (U_FAILURE(status)) {
SkDEBUGF("Break error: %s", u_errorName(status));