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

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

Issue 102243009: Revert of Revert of Shut up the CoreText performance note. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include <vector> 9 #include <vector>
10 #ifdef SK_BUILD_FOR_MAC 10 #ifdef SK_BUILD_FOR_MAC
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 NameFontStyleRec rec; 2100 NameFontStyleRec rec;
2101 CFStringToSkString(cfFamilyName, &rec.fFamilyName); 2101 CFStringToSkString(cfFamilyName, &rec.fFamilyName);
2102 rec.fFontStyle = desc2fontstyle(desc); 2102 rec.fFontStyle = desc2fontstyle(desc);
2103 2103
2104 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(nameFontStyleProc, 2104 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(nameFontStyleProc,
2105 &rec); 2105 &rec);
2106 if (face) { 2106 if (face) {
2107 return face; 2107 return face;
2108 } 2108 }
2109 2109
2110 AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithName(cfFamilyName, 1, NULL) ); 2110 AutoCFRelease<CFDictionaryRef> fontFamilyNameDictionary(
2111 CFDictionaryCreate(kCFAllocatorDefault,
2112 (const void**)&kCTFontFamilyNameAttribute, (const voi d**)&cfFamilyName,
2113 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionary ValueCallBacks));
2114 AutoCFRelease<CTFontDescriptorRef> fontDescriptor(
2115 CTFontDescriptorCreateWithAttributes(fontFamilyNameDictionary));
2116 AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithFontDescriptor(fontDescript or, 0, NULL));
2111 CTFontRef ctFont = CTFontCreateCopyWithAttributes(ctNamed, 1, NULL, desc); 2117 CTFontRef ctFont = CTFontCreateCopyWithAttributes(ctNamed, 1, NULL, desc);
2112 if (NULL == ctFont) { 2118 if (NULL == ctFont) {
2113 return NULL; 2119 return NULL;
2114 } 2120 }
2115 2121
2116 SkString str; 2122 SkString str;
2117 CFStringToSkString(cfFamilyName, &str); 2123 CFStringToSkString(cfFamilyName, &str);
2118 2124
2119 bool isFixedPitch; 2125 bool isFixedPitch;
2120 (void)computeStyleBits(ctFont, &isFixedPitch); 2126 (void)computeStyleBits(ctFont, &isFixedPitch);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits); 2313 return create_typeface(NULL, familyName, (SkTypeface::Style)styleBits);
2308 } 2314 }
2309 }; 2315 };
2310 2316
2311 /////////////////////////////////////////////////////////////////////////////// 2317 ///////////////////////////////////////////////////////////////////////////////
2312 2318
2313 SkFontMgr* SkFontMgr::Factory() { 2319 SkFontMgr* SkFontMgr::Factory() {
2314 return SkNEW(SkFontMgr_Mac); 2320 return SkNEW(SkFontMgr_Mac);
2315 } 2321 }
2316 #endif 2322 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698