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

Unified Diff: src/core/SkPaint.cpp

Issue 1813123003: Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.or… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move flag into sktypes, so it is visible to both paint and other patheffect clients Created 4 years, 9 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/core/SkDraw.cpp ('k') | src/core/SkPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 5e813f78c4d009c0ee56648b7ae66463a95bfdcb..331f7794bfe127b4a7b3641f6e81cc22857a4588 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -375,7 +375,9 @@ SET_PTR(ImageFilter)
SET_PTR(Shader)
SET_PTR(ColorFilter)
SET_PTR(Xfermode)
+#ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR
SET_PTR(PathEffect)
+#endif
SET_PTR(MaskFilter)
#undef SET_PTR
@@ -1930,7 +1932,7 @@ void SkPaint::unflatten(SkReadBuffer& buffer) {
}
if (flatFlags & kHasEffects_FlatFlag) {
- SkSafeUnref(this->setPathEffect(buffer.readPathEffect()));
+ this->setPathEffect(buffer.readPathEffect());
this->setShader(buffer.readShader());
SkSafeUnref(this->setXfermode(buffer.readXfermode()));
SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter()));
@@ -2250,11 +2252,11 @@ SkTextBaseIter::SkTextBaseIter(const char text[], size_t length,
fCache = fPaint.detachCache(nullptr, SkPaint::FakeGamma::On, nullptr);
SkPaint::Style style = SkPaint::kFill_Style;
- SkPathEffect* pe = nullptr;
+ sk_sp<SkPathEffect> pe;
if (!applyStrokeAndPathEffects) {
style = paint.getStyle(); // restore
- pe = paint.getPathEffect(); // restore
+ pe = sk_ref_sp(paint.getPathEffect()); // restore
}
fPaint.setStyle(style);
fPaint.setPathEffect(pe);
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698