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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 } | 926 } |
927 | 927 |
928 return nullptr; | 928 return nullptr; |
929 } | 929 } |
930 | 930 |
931 SkTypeface* SkFontMgr_DirectWrite::onCreateFromData(SkData* data, int ttcIndex)
const { | 931 SkTypeface* SkFontMgr_DirectWrite::onCreateFromData(SkData* data, int ttcIndex)
const { |
932 return this->createFromStream(new SkMemoryStream(sk_ref_sp(data)), ttcIndex)
; | 932 return this->createFromStream(new SkMemoryStream(sk_ref_sp(data)), ttcIndex)
; |
933 } | 933 } |
934 | 934 |
935 SkTypeface* SkFontMgr_DirectWrite::onCreateFromFile(const char path[], int ttcIn
dex) const { | 935 SkTypeface* SkFontMgr_DirectWrite::onCreateFromFile(const char path[], int ttcIn
dex) const { |
936 return this->createFromStream(SkStream::MakeFromFile(path).release(), ttcInd
ex); | 936 return this->createFromStream(SkStream::NewFromFile(path), ttcIndex); |
937 } | 937 } |
938 | 938 |
939 HRESULT SkFontMgr_DirectWrite::getByFamilyName(const WCHAR wideFamilyName[], | 939 HRESULT SkFontMgr_DirectWrite::getByFamilyName(const WCHAR wideFamilyName[], |
940 IDWriteFontFamily** fontFamily) c
onst { | 940 IDWriteFontFamily** fontFamily) c
onst { |
941 UINT32 index; | 941 UINT32 index; |
942 BOOL exists; | 942 BOOL exists; |
943 HR(fFontCollection->FindFamilyName(wideFamilyName, &index, &exists)); | 943 HR(fFontCollection->FindFamilyName(wideFamilyName, &index, &exists)); |
944 | 944 |
945 if (exists) { | 945 if (exists) { |
946 HR(fFontCollection->GetFontFamily(index, fontFamily)); | 946 HR(fFontCollection->GetFontFamily(index, fontFamily)); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 | 1086 |
1087 #include "SkFontMgr_indirect.h" | 1087 #include "SkFontMgr_indirect.h" |
1088 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { | 1088 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { |
1089 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); | 1089 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); |
1090 if (impl.get() == nullptr) { | 1090 if (impl.get() == nullptr) { |
1091 return nullptr; | 1091 return nullptr; |
1092 } | 1092 } |
1093 return new SkFontMgr_Indirect(impl.get(), proxy); | 1093 return new SkFontMgr_Indirect(impl.get(), proxy); |
1094 } | 1094 } |
1095 #endif//defined(SK_BUILD_FOR_WIN32) | 1095 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |