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

Unified Diff: src/fonts/SkGScalerContext.cpp

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 {

Powered by Google App Engine
This is Rietveld 408576698