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

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

Issue 1620333002: Revert of Consolidate SK_CRASH and sk_throw into SK_ABORT (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkMemory_malloc.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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 SkFontMgr_DirectWrite(IDWriteFactory* factory, IDWriteFontCollection* fontCo llection, 266 SkFontMgr_DirectWrite(IDWriteFactory* factory, IDWriteFontCollection* fontCo llection,
267 WCHAR* localeName, int localeNameLength) 267 WCHAR* localeName, int localeNameLength)
268 : fFactory(SkRefComPtr(factory)) 268 : fFactory(SkRefComPtr(factory))
269 , fFontCollection(SkRefComPtr(fontCollection)) 269 , fFontCollection(SkRefComPtr(fontCollection))
270 , fLocaleName(localeNameLength) 270 , fLocaleName(localeNameLength)
271 { 271 {
272 #if SK_HAS_DWRITE_2_H 272 #if SK_HAS_DWRITE_2_H
273 if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) { 273 if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) {
274 // IUnknown::QueryInterface states that if it fails, punk will be se t to nullptr. 274 // IUnknown::QueryInterface states that if it fails, punk will be se t to nullptr.
275 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx 275 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx
276 SkASSERT_RELEASE(nullptr == fFactory2.get()); 276 SK_ALWAYSBREAK(nullptr == fFactory2.get());
277 } 277 }
278 #endif 278 #endif
279 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR)); 279 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR));
280 } 280 }
281 281
282 protected: 282 protected:
283 int onCountFamilies() const override; 283 int onCountFamilies() const override;
284 void onGetFamilyName(int index, SkString* familyName) const override; 284 void onGetFamilyName(int index, SkString* familyName) const override;
285 SkFontStyleSet* onCreateStyleSet(int index) const override; 285 SkFontStyleSet* onCreateStyleSet(int index) const override;
286 SkFontStyleSet* onMatchFamily(const char familyName[]) const override; 286 SkFontStyleSet* onMatchFamily(const char familyName[]) const override;
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1100
1101 #include "SkFontMgr_indirect.h" 1101 #include "SkFontMgr_indirect.h"
1102 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { 1102 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
1103 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); 1103 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
1104 if (impl.get() == nullptr) { 1104 if (impl.get() == nullptr) {
1105 return nullptr; 1105 return nullptr;
1106 } 1106 }
1107 return new SkFontMgr_Indirect(impl.get(), proxy); 1107 return new SkFontMgr_Indirect(impl.get(), proxy);
1108 } 1108 }
1109 #endif//defined(SK_BUILD_FOR_WIN32) 1109 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkMemory_malloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698