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 | 7 |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 SkFontMgr_DirectWrite(IDWriteFactory* factory, IDWriteFontCollection* fontCo
llection, | 266 SkFontMgr_DirectWrite(IDWriteFactory* factory, IDWriteFontCollection* fontCo
llection, |
267 WCHAR* localeName, int localeNameLength) | 267 WCHAR* localeName, int localeNameLength) |
268 : fFactory(SkRefComPtr(factory)) | 268 : fFactory(SkRefComPtr(factory)) |
269 , fFontCollection(SkRefComPtr(fontCollection)) | 269 , fFontCollection(SkRefComPtr(fontCollection)) |
270 , fLocaleName(localeNameLength) | 270 , fLocaleName(localeNameLength) |
271 { | 271 { |
272 #if SK_HAS_DWRITE_2_H | 272 #if SK_HAS_DWRITE_2_H |
273 if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) { | 273 if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) { |
274 // IUnknown::QueryInterface states that if it fails, punk will be se
t to nullptr. | 274 // IUnknown::QueryInterface states that if it fails, punk will be se
t to nullptr. |
275 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx | 275 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx |
276 SkASSERT_RELEASE(nullptr == fFactory2.get()); | 276 SK_ALWAYSBREAK(nullptr == fFactory2.get()); |
277 } | 277 } |
278 #endif | 278 #endif |
279 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR)); | 279 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR)); |
280 } | 280 } |
281 | 281 |
282 protected: | 282 protected: |
283 int onCountFamilies() const override; | 283 int onCountFamilies() const override; |
284 void onGetFamilyName(int index, SkString* familyName) const override; | 284 void onGetFamilyName(int index, SkString* familyName) const override; |
285 SkFontStyleSet* onCreateStyleSet(int index) const override; | 285 SkFontStyleSet* onCreateStyleSet(int index) const override; |
286 SkFontStyleSet* onMatchFamily(const char familyName[]) const override; | 286 SkFontStyleSet* onMatchFamily(const char familyName[]) const override; |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 | 1100 |
1101 #include "SkFontMgr_indirect.h" | 1101 #include "SkFontMgr_indirect.h" |
1102 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { | 1102 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { |
1103 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); | 1103 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); |
1104 if (impl.get() == nullptr) { | 1104 if (impl.get() == nullptr) { |
1105 return nullptr; | 1105 return nullptr; |
1106 } | 1106 } |
1107 return new SkFontMgr_Indirect(impl.get(), proxy); | 1107 return new SkFontMgr_Indirect(impl.get(), proxy); |
1108 } | 1108 } |
1109 #endif//defined(SK_BUILD_FOR_WIN32) | 1109 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |