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

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

Issue 1610823002: Consolidate SK_CRASH and sk_throw into SK_ABORT (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows fix 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/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_win_dw.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 "SkDataTable.h" 8 #include "SkDataTable.h"
9 #include "SkFixed.h" 9 #include "SkFixed.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 template<typename T, void (*D)(T*)> void FcTDestroy(T* t) { 107 template<typename T, void (*D)(T*)> void FcTDestroy(T* t) {
108 FCLocker::AssertHeld(); 108 FCLocker::AssertHeld();
109 D(t); 109 D(t);
110 } 110 }
111 template <typename T, T* (*C)(), void (*D)(T*)> class SkAutoFc 111 template <typename T, T* (*C)(), void (*D)(T*)> class SkAutoFc
112 : public SkAutoTCallVProc<T, FcTDestroy<T, D> > { 112 : public SkAutoTCallVProc<T, FcTDestroy<T, D> > {
113 public: 113 public:
114 SkAutoFc() : SkAutoTCallVProc<T, FcTDestroy<T, D> >(C()) { 114 SkAutoFc() : SkAutoTCallVProc<T, FcTDestroy<T, D> >(C()) {
115 T* obj = this->operator T*(); 115 T* obj = this->operator T*();
116 SK_ALWAYSBREAK(nullptr != obj); 116 SkASSERT_RELEASE(nullptr != obj);
117 } 117 }
118 explicit SkAutoFc(T* obj) : SkAutoTCallVProc<T, FcTDestroy<T, D> >(obj) {} 118 explicit SkAutoFc(T* obj) : SkAutoTCallVProc<T, FcTDestroy<T, D> >(obj) {}
119 }; 119 };
120 120
121 typedef SkAutoFc<FcCharSet, FcCharSetCreate, FcCharSetDestroy> SkAutoFcCharSet; 121 typedef SkAutoFc<FcCharSet, FcCharSetCreate, FcCharSetDestroy> SkAutoFcCharSet;
122 typedef SkAutoFc<FcConfig, FcConfigCreate, FcConfigDestroy> SkAutoFcConfig; 122 typedef SkAutoFc<FcConfig, FcConfigCreate, FcConfigDestroy> SkAutoFcConfig;
123 typedef SkAutoFc<FcFontSet, FcFontSetCreate, FcFontSetDestroy> SkAutoFcFontSet; 123 typedef SkAutoFc<FcFontSet, FcFontSetCreate, FcFontSetDestroy> SkAutoFcFontSet;
124 typedef SkAutoFc<FcLangSet, FcLangSetCreate, FcLangSetDestroy> SkAutoFcLangSet; 124 typedef SkAutoFc<FcLangSet, FcLangSetCreate, FcLangSetDestroy> SkAutoFcLangSet;
125 typedef SkAutoFc<FcObjectSet, FcObjectSetCreate, FcObjectSetDestroy> SkAutoFcObj ectSet; 125 typedef SkAutoFc<FcObjectSet, FcObjectSetCreate, FcObjectSetDestroy> SkAutoFcObj ectSet;
126 typedef SkAutoFc<FcPattern, FcPatternCreate, FcPatternDestroy> SkAutoFcPattern; 126 typedef SkAutoFc<FcPattern, FcPatternCreate, FcPatternDestroy> SkAutoFcPattern;
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 return typeface.detach(); 873 return typeface.detach();
874 } 874 }
875 875
876 return this->matchFamilyStyle(nullptr, style); 876 return this->matchFamilyStyle(nullptr, style);
877 } 877 }
878 }; 878 };
879 879
880 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { 880 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) {
881 return new SkFontMgr_fontconfig(fc); 881 return new SkFontMgr_fontconfig(fc);
882 } 882 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698