| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include "SkTypes.h" | 7 #include "SkTypes.h" |
| 8 #if defined(SK_BUILD_FOR_WIN32) | 8 #if defined(SK_BUILD_FOR_WIN32) |
| 9 | 9 |
| 10 #include "SkDWrite.h" | 10 #include "SkDWrite.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 int count = fontFamily->GetFontCount(); | 165 int count = fontFamily->GetFontCount(); |
| 166 SkFontIdentity* fontIds; | 166 SkFontIdentity* fontIds; |
| 167 SkAutoTUnref<SkRemotableFontIdentitySet> fontIdSet( | 167 SkAutoTUnref<SkRemotableFontIdentitySet> fontIdSet( |
| 168 new SkRemotableFontIdentitySet(count, &fontIds)); | 168 new SkRemotableFontIdentitySet(count, &fontIds)); |
| 169 for (int fontIndex = 0; fontIndex < count; ++fontIndex) { | 169 for (int fontIndex = 0; fontIndex < count; ++fontIndex) { |
| 170 SkTScopedComPtr<IDWriteFont> font; | 170 SkTScopedComPtr<IDWriteFont> font; |
| 171 HRNM(fontFamily->GetFont(fontIndex, &font), "Could not get font."); | 171 HRNM(fontFamily->GetFont(fontIndex, &font), "Could not get font."); |
| 172 | 172 |
| 173 HRN(FontToIdentity(font.get(), &fontIds[fontIndex])); | 173 HRN(FontToIdentity(font.get(), &fontIds[fontIndex])); |
| 174 } | 174 } |
| 175 return fontIdSet.detach(); | 175 return fontIdSet.release(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 virtual SkFontIdentity matchIndexStyle(int familyIndex, | 178 virtual SkFontIdentity matchIndexStyle(int familyIndex, |
| 179 const SkFontStyle& pattern) const ove
rride | 179 const SkFontStyle& pattern) const ove
rride |
| 180 { | 180 { |
| 181 SkFontIdentity identity = { SkFontIdentity::kInvalidDataId }; | 181 SkFontIdentity identity = { SkFontIdentity::kInvalidDataId }; |
| 182 | 182 |
| 183 SkTScopedComPtr<IDWriteFontFamily> fontFamily; | 183 SkTScopedComPtr<IDWriteFontFamily> fontFamily; |
| 184 HR_GENERAL(fFontCollection->GetFontFamily(familyIndex, &fontFamily), | 184 HR_GENERAL(fFontCollection->GetFontFamily(familyIndex, &fontFamily), |
| 185 "Could not get requested family.", | 185 "Could not get requested family.", |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 } else { | 497 } else { |
| 498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); | 498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); |
| 499 if (localeNameLen) { | 499 if (localeNameLen) { |
| 500 localeName = localeNameStorage; | 500 localeName = localeNameStorage; |
| 501 }; | 501 }; |
| 502 } | 502 } |
| 503 | 503 |
| 504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam
e, localeNameLen); | 504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam
e, localeNameLen); |
| 505 } | 505 } |
| 506 #endif//defined(SK_BUILD_FOR_WIN32) | 506 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |