From f107a2fd014cd39c489060f2cd1b99cd49c7d0be Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Wed, 25 Jul 2018 16:52:48 -0400 Subject: SkUTF Create new header and namespace, `SkUTF` where we are putting all of our robust, well documented UTF-8, UTF-16, and UTF-32 functions: `SkUTF::{Count,Next,To}UTF{8,16,32}()`. SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable for re-use in other modules. Some of the old UTF-{8,16} functions still live in SkUtils.h; their use will be phased out in future CLs. Also added more unit testing and cleaned up old tests. Removed functions that were unused outside of tests or used only once. Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380 Reviewed-on: https://skia-review.googlesource.com/143306 Reviewed-by: Ben Wagner Commit-Queue: Hal Canary --- tests/PaintTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/PaintTest.cpp') diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index 647f8e2f23..0bf6df64de 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -23,7 +23,7 @@ static size_t uni_to_utf8(const SkUnichar src[], void* dst, int count) { char* u8 = (char*)dst; for (int i = 0; i < count; ++i) { - int n = SkToInt(SkUTF8_FromUnichar(src[i], u8)); + int n = SkToInt(SkUTF::ToUTF8(src[i], u8)); u8 += n; } return u8 - (char*)dst; @@ -32,7 +32,7 @@ static size_t uni_to_utf8(const SkUnichar src[], void* dst, int count) { static size_t uni_to_utf16(const SkUnichar src[], void* dst, int count) { uint16_t* u16 = (uint16_t*)dst; for (int i = 0; i < count; ++i) { - int n = SkToInt(SkUTF16_FromUnichar(src[i], u16)); + int n = SkToInt(SkUTF::ToUTF16(src[i], u16)); u16 += n; } return (char*)u16 - (char*)dst; -- cgit v1.2.3