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

Unified Diff: src/core/SkTypefacePriv.h

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. Created 4 years, 7 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 | « src/core/SkTypeface.cpp ('k') | src/fonts/SkGScalerContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypefacePriv.h
diff --git a/src/core/SkTypefacePriv.h b/src/core/SkTypefacePriv.h
index dc993d08902ebfabf005bea2a9d3666fd222a4e5..f8d7e63efd97474093bea55566d1d802080eb54d 100644
--- a/src/core/SkTypefacePriv.h
+++ b/src/core/SkTypefacePriv.h
@@ -16,23 +16,23 @@
* If the parameter is non-null, it will be ref'd and returned, otherwise
* it will be the default typeface.
*/
-static inline SkTypeface* ref_or_default(SkTypeface* face) {
- return face ? SkRef(face) : SkTypeface::RefDefault();
+static inline sk_sp<SkTypeface> ref_or_default(SkTypeface* face) {
+ return face ? sk_ref_sp(face) : SkTypeface::MakeDefault();
}
/**
* Always resolves to a non-null typeface, either the value passed to its
* constructor, or the default typeface if null was passed.
*/
-class SkAutoResolveDefaultTypeface : public SkAutoTUnref<SkTypeface> {
+class SkAutoResolveDefaultTypeface : public sk_sp<SkTypeface> {
public:
- SkAutoResolveDefaultTypeface() : INHERITED(SkTypeface::RefDefault()) {}
+ SkAutoResolveDefaultTypeface() : INHERITED(SkTypeface::MakeDefault()) {}
SkAutoResolveDefaultTypeface(SkTypeface* face)
: INHERITED(ref_or_default(face)) {}
private:
- typedef SkAutoTUnref<SkTypeface> INHERITED;
+ typedef sk_sp<SkTypeface> INHERITED;
};
#endif
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/fonts/SkGScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698