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

Unified Diff: src/core/SkTypefacePriv.h

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/core/SkTypefacePriv.h
diff --git a/src/core/SkTypefacePriv.h b/src/core/SkTypefacePriv.h
index f8d7e63efd97474093bea55566d1d802080eb54d..dc993d08902ebfabf005bea2a9d3666fd222a4e5 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 sk_sp<SkTypeface> ref_or_default(SkTypeface* face) {
- return face ? sk_ref_sp(face) : SkTypeface::MakeDefault();
+static inline SkTypeface* ref_or_default(SkTypeface* face) {
+ return face ? SkRef(face) : SkTypeface::RefDefault();
}
/**
* 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 sk_sp<SkTypeface> {
+class SkAutoResolveDefaultTypeface : public SkAutoTUnref<SkTypeface> {
public:
- SkAutoResolveDefaultTypeface() : INHERITED(SkTypeface::MakeDefault()) {}
+ SkAutoResolveDefaultTypeface() : INHERITED(SkTypeface::RefDefault()) {}
SkAutoResolveDefaultTypeface(SkTypeface* face)
: INHERITED(ref_or_default(face)) {}
private:
- typedef sk_sp<SkTypeface> INHERITED;
+ typedef SkAutoTUnref<SkTypeface> INHERITED;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698