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

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

Issue 326413003: SkNEW as default Create() for SkLazyPtr macros. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update exemption Created 6 years, 6 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/core/SkLazyPtr.h ('k') | no next file » | 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 2009 Google Inc. 2 * Copyright 2009 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9 9
10 #include <string> 10 #include <string>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // new APIs 117 // new APIs
118 virtual SkDataTable* getFamilyNames() SK_OVERRIDE; 118 virtual SkDataTable* getFamilyNames() SK_OVERRIDE;
119 virtual bool matchFamilySet(const char inFamilyName[], 119 virtual bool matchFamilySet(const char inFamilyName[],
120 SkString* outFamilyName, 120 SkString* outFamilyName,
121 SkTArray<FontIdentity>*) SK_OVERRIDE; 121 SkTArray<FontIdentity>*) SK_OVERRIDE;
122 122
123 private: 123 private:
124 SkMutex mutex_; 124 SkMutex mutex_;
125 }; 125 };
126 126
127 namespace {
128 SkFontConfigInterface* create_direct() { return SkNEW(SkFontConfigInterfaceDirec t); }
129 } // namespace
130
131 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { 127 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
132 SK_DECLARE_STATIC_LAZY_PTR(SkFontConfigInterface, direct, create_direct); 128 SK_DECLARE_STATIC_LAZY_PTR(SkFontConfigInterfaceDirect, direct);
133 return direct.get(); 129 return direct.get();
134 } 130 }
135 131
136 /////////////////////////////////////////////////////////////////////////////// 132 ///////////////////////////////////////////////////////////////////////////////
137 133
138 // Returns the string from the pattern, or NULL 134 // Returns the string from the pattern, or NULL
139 static const char* get_name(FcPattern* pattern, const char field[], 135 static const char* get_name(FcPattern* pattern, const char field[],
140 int index = 0) { 136 int index = 0) {
141 const char* name; 137 const char* name;
142 if (FcPatternGetString(pattern, field, index, 138 if (FcPatternGetString(pattern, field, index,
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 *trimmedMatches.append() = match[i]; 720 *trimmedMatches.append() = match[i];
725 } 721 }
726 } 722 }
727 723
728 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, 724 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC,
729 (trimmedMatches.begin(), 725 (trimmedMatches.begin(),
730 trimmedMatches.count())); 726 trimmedMatches.count()));
731 #endif 727 #endif
732 return false; 728 return false;
733 } 729 }
OLDNEW
« no previous file with comments | « src/core/SkLazyPtr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698