Shut up the CoreText performance note.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Dec 2013 16:27:44 +0000 (16:27 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Dec 2013 16:27:44 +0000 (16:27 +0000)
Aped from https://codereview.qt-project.org/70097

Please keep in mind: https://www.google.com/search?q=i+have+no+idea+what+i'm+doing+dog&tbm=isch

BUG=
R=bungeman@google.com, reed@google.com

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/109033002

git-svn-id: http://skia.googlecode.com/svn/trunk@12599 2bbb7eff-a529-9590-31e7-b0007b416f81

src/ports/SkFontHost_mac.cpp

index 3c1a274..fe3fd06 100755 (executable)
@@ -2107,7 +2107,13 @@ static SkTypeface* createFromDesc(CFStringRef cfFamilyName,
         return face;
     }
 
-    AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithName(cfFamilyName, 1, NULL));
+    AutoCFRelease<CFDictionaryRef> fontFamilyNameDictionary(
+        CFDictionaryCreate(kCFAllocatorDefault,
+                           (const void**)&kCTFontFamilyNameAttribute, (const void**)&cfFamilyName,
+                           1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+    AutoCFRelease<CTFontDescriptorRef> fontDescriptor(
+        CTFontDescriptorCreateWithAttributes(fontFamilyNameDictionary));
+    AutoCFRelease<CTFontRef> ctNamed(CTFontCreateWithFontDescriptor(fontDescriptor, 0, NULL));
     CTFontRef ctFont = CTFontCreateCopyWithAttributes(ctNamed, 1, NULL, desc);
     if (NULL == ctFont) {
         return NULL;