aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_mac.cpp6
-rw-r--r--src/ports/SkFontHost_win.cpp6
-rw-r--r--src/ports/SkFontMgr_win_dw.cpp2
-rw-r--r--src/ports/SkOSFile_stdio.cpp6
-rw-r--r--src/ports/SkRemotableFontMgr_win_dw.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 18d09b4ec0..8fa8c636d6 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1146,7 +1146,7 @@ uint16_t SkScalerContext_Mac::generateCharToGlyph(SkUnichar uni) {
UniChar theChar[2]; // UniChar is a UTF-16 16-bit code unit.
// Get the glyph
- size_t numUniChar = SkUTF16_FromUnichar(uni, theChar);
+ size_t numUniChar = SkUTF::ToUTF16(uni, theChar);
SkASSERT(sizeof(CGGlyph) <= sizeof(uint16_t));
// Undocumented behavior of CTFontGetGlyphsForCharacters with non-bmp code points:
@@ -2366,7 +2366,7 @@ int SkTypeface_Mac::onCharsToGlyphs(const void* chars, Encoding encoding,
src = utf16;
for (int i = 0; i < glyphCount; ++i) {
SkUnichar uni = SkUTF8_NextUnichar(&utf8);
- utf16 += SkUTF16_FromUnichar(uni, utf16);
+ utf16 += SkUTF::ToUTF16(uni, utf16);
}
srcCount = SkToInt(utf16 - src);
break;
@@ -2387,7 +2387,7 @@ int SkTypeface_Mac::onCharsToGlyphs(const void* chars, Encoding encoding,
UniChar* utf16 = charStorage.reset(2 * glyphCount);
src = utf16;
for (int i = 0; i < glyphCount; ++i) {
- utf16 += SkUTF16_FromUnichar(utf32[i], utf16);
+ utf16 += SkUTF::ToUTF16(utf32[i], utf16);
}
srcCount = SkToInt(utf16 - src);
break;
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 07d37aedfe..4ee8bb44fd 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -795,7 +795,7 @@ uint16_t SkScalerContext_GDI::generateCharToGlyph(SkUnichar utf32) {
uint16_t index = 0;
WCHAR utf16[2];
// TODO(ctguil): Support characters that generate more than one glyph.
- if (SkUTF16_FromUnichar(utf32, (uint16_t*)utf16) == 1) {
+ if (SkUTF::ToUTF16(utf32, (uint16_t*)utf16) == 1) {
// Type1 fonts fail with uniscribe API. Use GetGlyphIndices for plane 0.
/** Real documentation for GetGlyphIndiciesW:
@@ -2103,7 +2103,7 @@ int LogFontTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
// Try a run of non-bmp.
while (glyphIndex < glyphCount && currentChar > 0xFFFF) {
- SkUTF16_FromUnichar(currentChar, reinterpret_cast<uint16_t*>(scratch));
+ SkUTF::ToUTF16(currentChar, reinterpret_cast<uint16_t*>(scratch));
glyphs[glyphIndex] = nonBmpCharToGlyph(hdc, &sc, scratch);
++glyphIndex;
if (glyphIndex < glyphCount) {
@@ -2158,7 +2158,7 @@ int LogFontTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
// Try a run of non-bmp.
while (glyphIndex < glyphCount && utf32[glyphIndex] > 0xFFFF) {
- SkUTF16_FromUnichar(utf32[glyphIndex], reinterpret_cast<uint16_t*>(scratch));
+ SkUTF::ToUTF16(utf32[glyphIndex], reinterpret_cast<uint16_t*>(scratch));
glyphs[glyphIndex] = nonBmpCharToGlyph(hdc, &sc, scratch);
++glyphIndex;
}
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index 6830d82e03..7954c77ca2 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -757,7 +757,7 @@ SkTypeface* SkFontMgr_DirectWrite::onMatchFamilyStyleCharacter(const char family
WCHAR str[16];
UINT32 strLen = static_cast<UINT32>(
- SkUTF16_FromUnichar(character, reinterpret_cast<uint16_t*>(str)));
+ SkUTF::ToUTF16(character, reinterpret_cast<uint16_t*>(str)));
const SkSMallocWCHAR* dwBcp47;
SkSMallocWCHAR dwBcp47Local;
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index 10ba7c8b0c..8c0be793cd 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -46,16 +46,16 @@ static FILE* fopen_win(const char* utf8path, const char* perm) {
const char* end = utf8path + strlen(utf8path);
size_t n = 0;
while (ptr < end) {
- SkUnichar u = SkUTF8_NextUnicharWithError(&ptr, end);
+ SkUnichar u = SkUTF::NextUTF8(&ptr, end);
if (u < 0) {
return nullptr; // malformed UTF-8
}
- n += SkUTF16_FromUnichar(u);
+ n += SkUTF::ToUTF16(u);
}
std::vector<uint16_t> wchars(n + 1);
uint16_t* out = wchars.data();
for (const char* ptr = utf8path; ptr < end;) {
- out += SkUTF16_FromUnichar(SkUTF8_NextUnicharWithError(&ptr, end), out);
+ out += SkUTF::ToUTF16(SkUTF::NextUTF8(&ptr, end), out);
}
SkASSERT(out == &wchars[n]);
*out = 0; // final null
diff --git a/src/ports/SkRemotableFontMgr_win_dw.cpp b/src/ports/SkRemotableFontMgr_win_dw.cpp
index 6c6613ea37..2b99cf7be8 100644
--- a/src/ports/SkRemotableFontMgr_win_dw.cpp
+++ b/src/ports/SkRemotableFontMgr_win_dw.cpp
@@ -398,7 +398,7 @@ public:
WCHAR str[16];
UINT32 strLen = static_cast<UINT32>(
- SkUTF16_FromUnichar(character, reinterpret_cast<uint16_t*>(str)));
+ SkUTF::ToUTF16(character, reinterpret_cast<uint16_t*>(str)));
SkTScopedComPtr<IDWriteTextLayout> fallbackLayout;
HR_GENERAL(dwFactory->CreateTextLayout(str, strLen, fallbackFormat.get(),
200.0f, 200.0f,