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

Unified Diff: include/core/SkFont.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: include/core/SkFont.h
diff --git a/include/core/SkFont.h b/include/core/SkFont.h
index 6c231c963a0fe6996c97511c0828edb82b9c2598..e4ebebb244aff0bf780f5f186f0f38a4ae8d9536 100644
--- a/include/core/SkFont.h
+++ b/include/core/SkFont.h
@@ -117,17 +117,17 @@
kLCD_MaskType,
};
- static sk_sp<SkFont> Make(sk_sp<SkTypeface>, SkScalar size, MaskType, uint32_t flags);
- static sk_sp<SkFont> Make(sk_sp<SkTypeface>, SkScalar size, SkScalar scaleX, SkScalar skewX,
- MaskType, uint32_t flags);
+ static SkFont* Create(SkTypeface*, SkScalar size, MaskType, uint32_t flags);
+ static SkFont* Create(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX,
+ MaskType, uint32_t flags);
/**
* Return a font with the same attributes of this font, but with the specified size.
* If size is not supported (e.g. <= 0 or non-finite) NULL will be returned.
*/
- sk_sp<SkFont> makeWithSize(SkScalar size) const;
+ SkFont* cloneWithSize(SkScalar size) const;
- SkTypeface* getTypeface() const { return fTypeface.get(); }
+ SkTypeface* getTypeface() const { return fTypeface; }
SkScalar getSize() const { return fSize; }
SkScalar getScaleX() const { return fScaleX; }
SkScalar getSkewX() const { return fSkewX; }
@@ -145,17 +145,17 @@
SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) const;
- static sk_sp<SkFont> Testing_CreateFromPaint(const SkPaint&);
+ static SkFont* Testing_CreateFromPaint(const SkPaint&);
private:
enum {
kAllFlags = 0xFF,
};
- SkFont(sk_sp<SkTypeface>, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType,
- uint32_t flags);
+ SkFont(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType, uint32_t flags);
+ virtual ~SkFont();
- sk_sp<SkTypeface> fTypeface;
+ SkTypeface* fTypeface;
SkScalar fSize;
SkScalar fScaleX;
SkScalar fSkewX;

Powered by Google App Engine
This is Rietveld 408576698