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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/SkImageGeneratorCG.cpp ('k') | src/sfnt/SkOTUtils.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 #include "SkTypes.h" 7 #include "SkTypes.h"
8 #if defined(SK_BUILD_FOR_WIN32) 8 #if defined(SK_BUILD_FOR_WIN32)
9 9
10 #include "SkDWrite.h" 10 #include "SkDWrite.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 int count = fontFamily->GetFontCount(); 165 int count = fontFamily->GetFontCount();
166 SkFontIdentity* fontIds; 166 SkFontIdentity* fontIds;
167 SkAutoTUnref<SkRemotableFontIdentitySet> fontIdSet( 167 SkAutoTUnref<SkRemotableFontIdentitySet> fontIdSet(
168 new SkRemotableFontIdentitySet(count, &fontIds)); 168 new SkRemotableFontIdentitySet(count, &fontIds));
169 for (int fontIndex = 0; fontIndex < count; ++fontIndex) { 169 for (int fontIndex = 0; fontIndex < count; ++fontIndex) {
170 SkTScopedComPtr<IDWriteFont> font; 170 SkTScopedComPtr<IDWriteFont> font;
171 HRNM(fontFamily->GetFont(fontIndex, &font), "Could not get font."); 171 HRNM(fontFamily->GetFont(fontIndex, &font), "Could not get font.");
172 172
173 HRN(FontToIdentity(font.get(), &fontIds[fontIndex])); 173 HRN(FontToIdentity(font.get(), &fontIds[fontIndex]));
174 } 174 }
175 return fontIdSet.detach(); 175 return fontIdSet.release();
176 } 176 }
177 177
178 virtual SkFontIdentity matchIndexStyle(int familyIndex, 178 virtual SkFontIdentity matchIndexStyle(int familyIndex,
179 const SkFontStyle& pattern) const ove rride 179 const SkFontStyle& pattern) const ove rride
180 { 180 {
181 SkFontIdentity identity = { SkFontIdentity::kInvalidDataId }; 181 SkFontIdentity identity = { SkFontIdentity::kInvalidDataId };
182 182
183 SkTScopedComPtr<IDWriteFontFamily> fontFamily; 183 SkTScopedComPtr<IDWriteFontFamily> fontFamily;
184 HR_GENERAL(fFontCollection->GetFontFamily(familyIndex, &fontFamily), 184 HR_GENERAL(fFontCollection->GetFontFamily(familyIndex, &fontFamily),
185 "Could not get requested family.", 185 "Could not get requested family.",
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } else { 497 } else {
498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH); 498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH);
499 if (localeNameLen) { 499 if (localeNameLen) {
500 localeName = localeNameStorage; 500 localeName = localeNameStorage;
501 }; 501 };
502 } 502 }
503 503
504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam e, localeNameLen); 504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam e, localeNameLen);
505 } 505 }
506 #endif//defined(SK_BUILD_FOR_WIN32) 506 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/ports/SkImageGeneratorCG.cpp ('k') | src/sfnt/SkOTUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698