diff options
author | Hal Canary <halcanary@google.com> | 2018-03-01 15:56:37 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-01 22:16:34 +0000 |
commit | ee08b4a2e92e3273293a62cf1672d85ce9e9785f (patch) | |
tree | a64fc01c6eb77cc4c0aea8602293aa91d8669a83 /src/core/SkString.cpp | |
parent | 9b1a8860611e17fd25c0d322ef4d28cfa601e82e (diff) |
SkString: remove externally unused ::setUTF16() from API
Moved to SkStringUtils in src/
Change-Id: I026e3a325570bbf34e90797d921cb2f05b9a29f6
Reviewed-on: https://skia-review.googlesource.com/111602
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/core/SkString.cpp')
-rw-r--r-- | src/core/SkString.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp index d388f18ec7..554cde8f9f 100644 --- a/src/core/SkString.cpp +++ b/src/core/SkString.cpp @@ -369,45 +369,6 @@ void SkString::set(const char text[], size_t len) { } } -void SkString::setUTF16(const uint16_t src[]) { - int count = 0; - - while (src[count]) { - count += 1; - } - this->setUTF16(src, count); -} - -static SkString utf8_from_utf16(const uint16_t src[], size_t count) { - SkString ret; - if (count > 0) { - SkASSERT(src); - size_t n = 0; - const uint16_t* end = src + count; - for (const uint16_t* ptr = src; ptr < end;) { - const uint16_t* last = ptr; - SkUnichar u = SkUTF16_NextUnichar(&ptr); - size_t s = SkUTF8_FromUnichar(u); - if (n > SK_MaxU32 - s) { - end = last; // truncate input string - break; - } - n += s; - } - ret = SkString(n); - char* out = ret.writable_str(); - for (const uint16_t* ptr = src; ptr < end;) { - out += SkUTF8_FromUnichar(SkUTF16_NextUnichar(&ptr), out); - } - SkASSERT(out == ret.writable_str() + n); - } - return ret; -} - -void SkString::setUTF16(const uint16_t src[], size_t count) { - *this = utf8_from_utf16(src, count); -} - void SkString::insert(size_t offset, const char text[]) { this->insert(offset, text, text ? strlen(text) : 0); } |