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

Unified Diff: include/ports/SkTypeface_mac.h

Issue 1163573007: Provide tag-along for SkCreateTypefaceFromCTFont. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add reference to bug. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/ports/SkTypeface_mac.h
diff --git a/include/ports/SkTypeface_mac.h b/include/ports/SkTypeface_mac.h
index a59f8f77735e4abe58e8c2a5b23ebb4c4190c286..000c7baa89a0a29b40d755e880f12e0f306935c9 100644
--- a/include/ports/SkTypeface_mac.h
+++ b/include/ports/SkTypeface_mac.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,25 +5,25 @@
* found in the LICENSE file.
*/
-
-
#ifndef SkTypeface_mac_DEFINED
#define SkTypeface_mac_DEFINED
#include "SkTypeface.h"
-#ifdef SK_BUILD_FOR_MAC
-#import <ApplicationServices/ApplicationServices.h>
-#endif
-#ifdef SK_BUILD_FOR_IOS
+#include <CoreFoundation/CoreFoundation.h>
#include <CoreText/CoreText.h>
-#endif
+
/**
* Like the other Typeface create methods, this returns a new reference to the
* corresponding typeface for the specified CTFontRef. The caller must call
* unref() when it is finished.
+ *
+ * The CFTypeRef parameter, if provided, will be kept referenced for the
+ * lifetime of the SkTypeface. This was introduced as a means to work around
+ * https://crbug.com/413332 .
*/
-SK_API extern SkTypeface* SkCreateTypefaceFromCTFont(CTFontRef);
+SK_API extern SkTypeface* SkCreateTypefaceFromCTFont(CTFontRef, CFTypeRef = NULL);
+
/**
* Returns the platform-specific CTFontRef handle for a
* given SkTypeface. Note that the returned CTFontRef gets
@@ -36,4 +35,5 @@ SK_API extern SkTypeface* SkCreateTypefaceFromCTFont(CTFontRef);
* See https://code.google.com/p/skia/issues/detail?id=3408
*/
SK_API extern CTFontRef SkTypeface_GetCTFontRef(const SkTypeface* face);
+
#endif
« no previous file with comments | « no previous file | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698