Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.org/1813553005/ )"
This reverts commit f28ad894272018fd2855e3f77ea1236ea0cce1c0.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813123003
TBR=
Review URL: https://codereview.chromium.org/1813123003
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index 6ad3d23..aa3d375 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -77,7 +77,7 @@
static void r5(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
rastBuilder->addLayer(p);
- p.setPathEffect(SkDiscretePathEffect::Create(SK_Scalar1*4, SK_Scalar1*3))->unref();
+ p.setPathEffect(SkDiscretePathEffect::Make(SK_Scalar1*4, SK_Scalar1*3));
p.setXfermodeMode(SkXfermode::kSrcOut_Mode);
rastBuilder->addLayer(p);
}
@@ -95,17 +95,17 @@
#include "Sk2DPathEffect.h"
-static SkPathEffect* MakeDotEffect(SkScalar radius, const SkMatrix& matrix) {
+static sk_sp<SkPathEffect> MakeDotEffect(SkScalar radius, const SkMatrix& matrix) {
SkPath path;
path.addCircle(0, 0, radius);
- return SkPath2DPathEffect::Create(matrix, path);
+ return SkPath2DPathEffect::Make(matrix, path);
}
static void r7(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
SkMatrix lattice;
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
- p.setPathEffect(MakeDotEffect(SK_Scalar1*4, lattice))->unref();
+ p.setPathEffect(MakeDotEffect(SK_Scalar1*4, lattice));
rastBuilder->addLayer(p);
}
@@ -115,7 +115,7 @@
SkMatrix lattice;
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
- p.setPathEffect(MakeDotEffect(SK_Scalar1*2, lattice))->unref();
+ p.setPathEffect(MakeDotEffect(SK_Scalar1*2, lattice));
p.setXfermodeMode(SkXfermode::kClear_Mode);
rastBuilder->addLayer(p);
@@ -132,7 +132,7 @@
SkMatrix lattice;
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
lattice.postRotate(SkIntToScalar(30), 0, 0);
- p.setPathEffect(SkLine2DPathEffect::Create(SK_Scalar1*2, lattice))->unref();
+ p.setPathEffect(SkLine2DPathEffect::Make(SK_Scalar1*2, lattice));
p.setXfermodeMode(SkXfermode::kClear_Mode);
rastBuilder->addLayer(p);