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 #ifndef SkTypeface_win_dw_DEFINED | 8 #ifndef SkTypeface_win_dw_DEFINED |
9 #define SkTypeface_win_dw_DEFINED | 9 #define SkTypeface_win_dw_DEFINED |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 SkTScopedComPtr<IDWriteFontFace1> fDWriteFontFace1; | 71 SkTScopedComPtr<IDWriteFontFace1> fDWriteFontFace1; |
72 #endif | 72 #endif |
73 | 73 |
74 static DWriteFontTypeface* Create(IDWriteFactory* factory, | 74 static DWriteFontTypeface* Create(IDWriteFactory* factory, |
75 IDWriteFontFace* fontFace, | 75 IDWriteFontFace* fontFace, |
76 IDWriteFont* font, | 76 IDWriteFont* font, |
77 IDWriteFontFamily* fontFamily, | 77 IDWriteFontFamily* fontFamily, |
78 IDWriteFontFileLoader* fontFileLoader = NU
LL, | 78 IDWriteFontFileLoader* fontFileLoader = NU
LL, |
79 IDWriteFontCollectionLoader* fontCollectio
nLoader = NULL) { | 79 IDWriteFontCollectionLoader* fontCollectio
nLoader = NULL) { |
80 SkFontID fontID = SkTypefaceCache::NewFontID(); | 80 SkFontID fontID = SkTypefaceCache::NewFontID(); |
81 return SkNEW_ARGS(DWriteFontTypeface, (get_style(font), fontID, | 81 return new DWriteFontTypeface(get_style(font), fontID, factory, fontFace
, font, fontFamily, |
82 factory, fontFace, font, fontFami
ly, | 82 fontFileLoader, fontCollectionLoader); |
83 fontFileLoader, fontCollectionLoa
der)); | |
84 } | 83 } |
85 | 84 |
86 protected: | 85 protected: |
87 void weak_dispose() const override { | 86 void weak_dispose() const override { |
88 if (fDWriteFontCollectionLoader.get()) { | 87 if (fDWriteFontCollectionLoader.get()) { |
89 HRV(fFactory->UnregisterFontCollectionLoader(fDWriteFontCollectionLo
ader.get())); | 88 HRV(fFactory->UnregisterFontCollectionLoader(fDWriteFontCollectionLo
ader.get())); |
90 } | 89 } |
91 if (fDWriteFontFileLoader.get()) { | 90 if (fDWriteFontFileLoader.get()) { |
92 HRV(fFactory->UnregisterFontFileLoader(fDWriteFontFileLoader.get()))
; | 91 HRV(fFactory->UnregisterFontFileLoader(fDWriteFontFileLoader.get()))
; |
93 } | 92 } |
(...skipping 16 matching lines...) Expand all Loading... |
110 SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override; | 109 SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override; |
111 int onGetTableTags(SkFontTableTag tags[]) const override; | 110 int onGetTableTags(SkFontTableTag tags[]) const override; |
112 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 111 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
113 size_t length, void* data) const override; | 112 size_t length, void* data) const override; |
114 | 113 |
115 private: | 114 private: |
116 typedef SkTypeface INHERITED; | 115 typedef SkTypeface INHERITED; |
117 }; | 116 }; |
118 | 117 |
119 #endif | 118 #endif |
OLD | NEW |