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

Unified Diff: samplecode/ClockFaceView.cpp

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 | « public.bzl ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/ClockFaceView.cpp
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index 6e2b2b158519ef2acefcb126bc087c7c1d62d2f8..7c6158ada3e9dcfe2d5afddb2089eefca5aed4cb 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -170,21 +170,17 @@ static void apply_shader(SkPaint* paint, float scale)
}
class ClockFaceView : public SkView {
- SkTypeface* fFace;
+ sk_sp<SkTypeface> fFace;
SkScalar fInterp;
SkScalar fDx;
public:
ClockFaceView() {
- fFace = SkTypeface::CreateFromFile("/Users/reed/Downloads/p052024l.pfb");
+ fFace = SkTypeface::MakeFromFile("/Users/reed/Downloads/p052024l.pfb");
fInterp = 0;
fDx = SK_Scalar1/64;
}
- virtual ~ClockFaceView() {
- SkSafeUnref(fFace);
- }
-
protected:
// overrides from SkEventSink
virtual bool onQuery(SkEvent* evt) {
@@ -225,8 +221,7 @@ protected:
paint.setAntiAlias(true);
paint.setTextSize(SkIntToScalar(240));
- paint.setTypeface(SkTypeface::CreateFromName("sans-serif",
- SkTypeface::kBold));
+ paint.setTypeface(SkTypeface::MakeFromName("sans-serif", SkTypeface::kBold));
SkString str("9");
« no previous file with comments | « public.bzl ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698