Index: src/fonts/SkGScalerContext.cpp |
diff --git a/src/fonts/SkGScalerContext.cpp b/src/fonts/SkGScalerContext.cpp |
index 1d34536cbe2933eff5094d3791f1665f4fea0275..0a9601bd7e48cd1afb080557a340fcbf3c7136b7 100644 |
--- a/src/fonts/SkGScalerContext.cpp |
+++ b/src/fonts/SkGScalerContext.cpp |
@@ -151,11 +151,14 @@ |
#include "SkTypefaceCache.h" |
-SkGTypeface::SkGTypeface(sk_sp<SkTypeface> proxy, const SkPaint& paint) |
+SkGTypeface::SkGTypeface(SkTypeface* proxy, const SkPaint& paint) |
: SkTypeface(proxy->fontStyle(), SkTypefaceCache::NewFontID(), false) |
- , fProxy(std::move(proxy)) |
- , fPaint(paint) |
-{} |
+ , fProxy(SkRef(proxy)) |
+ , fPaint(paint) {} |
+ |
+SkGTypeface::~SkGTypeface() { |
+ fProxy->unref(); |
+} |
SkScalerContext* SkGTypeface::onCreateScalerContext(const SkScalerContextEffects& effects, |
const SkDescriptor* desc) const { |