aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/animator
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-05-11 12:38:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-11 12:38:18 -0700
commit6296da736fbf40aae881650c239420f64e576c3f (patch)
tree5121ecf46ff7099d8eb66d2b2a4671d5ad94db89 /src/animator
parentc8699321b924c1f284df93cb29b86000c1d73c0a (diff)
Move SkTypeface to sk_sp.
Diffstat (limited to 'src/animator')
-rw-r--r--src/animator/SkDrawPaint.cpp2
-rw-r--r--src/animator/SkPaintPart.h3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/animator/SkDrawPaint.cpp b/src/animator/SkDrawPaint.cpp
index 1336ea2dc4..1026630eb1 100644
--- a/src/animator/SkDrawPaint.cpp
+++ b/src/animator/SkDrawPaint.cpp
@@ -259,7 +259,7 @@ void SkDrawPaint::setupPaint(SkPaint* paint) const {
if (typeface == nullptr)
paint->setTypeface(nullptr);
else if (typeface != (SkDrawTypeface*) -1)
- SkSafeUnref(paint->setTypeface(typeface->getTypeface()));
+ paint->setTypeface(typeface->getTypeface());
if (underline != -1)
paint->setUnderlineText(SkToBool(underline));
if (xfermode != -1)
diff --git a/src/animator/SkPaintPart.h b/src/animator/SkPaintPart.h
index a7e28ed3e2..5d94f049e8 100644
--- a/src/animator/SkPaintPart.h
+++ b/src/animator/SkPaintPart.h
@@ -62,8 +62,7 @@ class SkDrawTypeface : public SkPaintPart {
#ifdef SK_DUMP_ENABLED
void dump(SkAnimateMaker *) override;
#endif
- SkTypeface* getTypeface() {
- return SkTypeface::CreateFromName(fontName.c_str(), style); }
+ sk_sp<SkTypeface> getTypeface() { return SkTypeface::MakeFromName(fontName.c_str(), style); }
protected:
bool add() override;
SkString fontName;