Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: src/ports/SkFontMgr_win_dw.cpp

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Add trivial bodies to the trivial implementations. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/utils/SkWhitelistTypefaces.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::NewFromFile(path), ttcIndex); 936 return this->createFromStream(SkStream::MakeFromFile(path).release(), ttcInd ex);
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
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)
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/utils/SkWhitelistTypefaces.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698