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

Unified Diff: src/core/SkPaint.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make vc++ happy. Created 4 years, 8 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/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 3fd25b48e165ab20d10cc0040cf469b0fcfa0e01..83539dced509328e0d444a849325bf238d1accd3 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -369,7 +369,9 @@ void SkPaint::setLooper(sk_sp<SkDrawLooper> looper) { fLooper = std::move(looper
this->f##Field.reset(SkSafeRef(f)); \
return f; \
}
+#ifdef SK_SUPPORT_LEGACY_TYPEFACE_PTR
SET_PTR(Typeface)
+#endif
#ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR
SET_PTR(Rasterizer)
#endif
@@ -1896,7 +1898,7 @@ void SkPaint::unflatten(SkReadBuffer& buffer) {
this->setTextEncoding(static_cast<TextEncoding>((tmp >> 0) & 0xFF));
if (flatFlags & kHasTypeface_FlatFlag) {
- this->setTypeface(buffer.readTypeface());
+ this->setTypeface(sk_ref_sp(buffer.readTypeface()));
} else {
this->setTypeface(nullptr);
}

Powered by Google App Engine
This is Rietveld 408576698