SkPDF/SkTypefaceMetrics: Set PostScript Name in Directwrite backend.
Also, clean up Freetype and Mac impls.
Also, sk_get_locale_string returns an error value.
Change-Id: If8dfc101e28a1d782679174fe6f5a28812563af5
Reviewed-on: https://skia-review.googlesource.com/117229
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/src/utils/win/SkDWrite.cpp b/src/utils/win/SkDWrite.cpp
index c7438bf..7a88fcb 100644
--- a/src/utils/win/SkDWrite.cpp
+++ b/src/utils/win/SkDWrite.cpp
@@ -90,25 +90,26 @@
////////////////////////////////////////////////////////////////////////////////
// Locale
-void sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedLocale,
- SkString* skname) {
+HRESULT sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedLocale,
+ SkString* skname) {
UINT32 nameIndex = 0;
if (preferedLocale) {
// Ignore any errors and continue with index 0 if there is a problem.
- BOOL nameExists;
- names->FindLocaleName(preferedLocale, &nameIndex, &nameExists);
+ BOOL nameExists = FALSE;
+ (void)names->FindLocaleName(preferedLocale, &nameIndex, &nameExists);
if (!nameExists) {
nameIndex = 0;
}
}
UINT32 nameLen;
- HRVM(names->GetStringLength(nameIndex, &nameLen), "Could not get name length.");
+ HRM(names->GetStringLength(nameIndex, &nameLen), "Could not get name length.");
- SkSMallocWCHAR name(nameLen+1);
- HRVM(names->GetString(nameIndex, name.get(), nameLen+1), "Could not get string.");
+ SkSMallocWCHAR name(nameLen + 1);
+ HRM(names->GetString(nameIndex, name.get(), nameLen + 1), "Could not get string.");
- HRV(sk_wchar_to_skstring(name.get(), nameLen, skname));
+ HR(sk_wchar_to_skstring(name.get(), nameLen, skname));
+ return S_OK;
}
HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc) {