Index: src/fonts/SkRandomScalerContext.cpp |
diff --git a/src/fonts/SkRandomScalerContext.cpp b/src/fonts/SkRandomScalerContext.cpp |
index 6d3718cbef0ef73085e750a0d11c3b837470430e..245052053e3d40f77413913d4bf7ff7d60e93908 100644 |
--- a/src/fonts/SkRandomScalerContext.cpp |
+++ b/src/fonts/SkRandomScalerContext.cpp |
@@ -190,11 +190,15 @@ |
#include "SkTypefaceCache.h" |
-SkRandomTypeface::SkRandomTypeface(sk_sp<SkTypeface> proxy, const SkPaint& paint, bool fakeIt) |
+SkRandomTypeface::SkRandomTypeface(SkTypeface* proxy, const SkPaint& paint, bool fakeIt) |
: SkTypeface(proxy->fontStyle(), SkTypefaceCache::NewFontID(), false) |
- , fProxy(std::move(proxy)) |
+ , fProxy(SkRef(proxy)) |
, fPaint(paint) |
, fFakeIt(fakeIt) {} |
+ |
+SkRandomTypeface::~SkRandomTypeface() { |
+ fProxy->unref(); |
+} |
SkScalerContext* SkRandomTypeface::onCreateScalerContext(const SkScalerContextEffects& effects, |
const SkDescriptor* desc) const { |