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

Unified Diff: src/fonts/SkGScalerContext.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 | « src/fonts/SkGScalerContext.h ('k') | src/fonts/SkRandomScalerContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkGScalerContext.cpp
diff --git a/src/fonts/SkGScalerContext.cpp b/src/fonts/SkGScalerContext.cpp
index 0a9601bd7e48cd1afb080557a340fcbf3c7136b7..1d34536cbe2933eff5094d3791f1665f4fea0275 100644
--- a/src/fonts/SkGScalerContext.cpp
+++ b/src/fonts/SkGScalerContext.cpp
@@ -151,14 +151,11 @@ void SkGScalerContext::generateFontMetrics(SkPaint::FontMetrics* metrics) {
#include "SkTypefaceCache.h"
-SkGTypeface::SkGTypeface(SkTypeface* proxy, const SkPaint& paint)
+SkGTypeface::SkGTypeface(sk_sp<SkTypeface> proxy, const SkPaint& paint)
: SkTypeface(proxy->fontStyle(), SkTypefaceCache::NewFontID(), false)
- , fProxy(SkRef(proxy))
- , fPaint(paint) {}
-
-SkGTypeface::~SkGTypeface() {
- fProxy->unref();
-}
+ , fProxy(std::move(proxy))
+ , fPaint(paint)
+{}
SkScalerContext* SkGTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
const SkDescriptor* desc) const {
« no previous file with comments | « src/fonts/SkGScalerContext.h ('k') | src/fonts/SkRandomScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698