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

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

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice 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/ports/SkImageGeneratorWIC.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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 autoUnregisterFontFileLoader.d etatch(), 922 autoUnregisterFontFileLoader.d etatch(),
923 autoUnregisterFontCollectionLo ader.detatch()); 923 autoUnregisterFontCollectionLo ader.detatch());
924 } 924 }
925 } 925 }
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(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::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;
(...skipping 143 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/ports/SkImageGeneratorWIC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698