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

Unified Diff: include/core/SkFont.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 | « gyp/skia_for_android_framework_defines.gypi ('k') | include/core/SkPaint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkFont.h
diff --git a/include/core/SkFont.h b/include/core/SkFont.h
index e4ebebb244aff0bf780f5f186f0f38a4ae8d9536..6c231c963a0fe6996c97511c0828edb82b9c2598 100644
--- a/include/core/SkFont.h
+++ b/include/core/SkFont.h
@@ -117,17 +117,17 @@ public:
kLCD_MaskType,
};
- static SkFont* Create(SkTypeface*, SkScalar size, MaskType, uint32_t flags);
- static SkFont* Create(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX,
- MaskType, uint32_t flags);
+ 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);
/**
* 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.
*/
- SkFont* cloneWithSize(SkScalar size) const;
+ sk_sp<SkFont> makeWithSize(SkScalar size) const;
- SkTypeface* getTypeface() const { return fTypeface; }
+ SkTypeface* getTypeface() const { return fTypeface.get(); }
SkScalar getSize() const { return fSize; }
SkScalar getScaleX() const { return fScaleX; }
SkScalar getSkewX() const { return fSkewX; }
@@ -145,17 +145,17 @@ public:
SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) const;
- static SkFont* Testing_CreateFromPaint(const SkPaint&);
+ static sk_sp<SkFont> Testing_CreateFromPaint(const SkPaint&);
private:
enum {
kAllFlags = 0xFF,
};
- SkFont(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType, uint32_t flags);
- virtual ~SkFont();
+ SkFont(sk_sp<SkTypeface>, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType,
+ uint32_t flags);
- SkTypeface* fTypeface;
+ sk_sp<SkTypeface> fTypeface;
SkScalar fSize;
SkScalar fScaleX;
SkScalar fSkewX;
« no previous file with comments | « gyp/skia_for_android_framework_defines.gypi ('k') | include/core/SkPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698