| Index: gm/patheffects.cpp
|
| diff --git a/gm/patheffects.cpp b/gm/patheffects.cpp
|
| index 9821b3a35d23626f3039235eb912c1930da41257..517d02e5477426bc9475538f4d793117606bff3d 100644
|
| --- a/gm/patheffects.cpp
|
| +++ b/gm/patheffects.cpp
|
| @@ -17,14 +17,15 @@
|
|
|
| static void compose_pe(SkPaint* paint) {
|
| SkPathEffect* pe = paint->getPathEffect();
|
| - sk_sp<SkPathEffect> corner = SkCornerPathEffect::Make(25);
|
| - sk_sp<SkPathEffect> compose;
|
| + SkPathEffect* corner = SkCornerPathEffect::Create(25);
|
| + SkPathEffect* compose;
|
| if (pe) {
|
| - compose = SkComposePathEffect::Make(sk_ref_sp(pe), corner);
|
| + compose = SkComposePathEffect::Create(pe, corner);
|
| + corner->unref();
|
| } else {
|
| compose = corner;
|
| }
|
| - paint->setPathEffect(compose);
|
| + paint->setPathEffect(compose)->unref();
|
| }
|
|
|
| static void hair_pe(SkPaint* paint) {
|
| @@ -44,7 +45,8 @@
|
| static void dash_pe(SkPaint* paint) {
|
| SkScalar inter[] = { 20, 10, 10, 10 };
|
| paint->setStrokeWidth(12);
|
| - paint->setPathEffect(SkDashPathEffect::Make(inter, SK_ARRAY_COUNT(inter), 0));
|
| + paint->setPathEffect(SkDashPathEffect::Create(inter, SK_ARRAY_COUNT(inter),
|
| + 0))->unref();
|
| compose_pe(paint);
|
| }
|
|
|
| @@ -67,8 +69,8 @@
|
| path.offset(SkIntToScalar(-6), 0);
|
| scale(&path, 1.5f);
|
|
|
| - paint->setPathEffect(SkPath1DPathEffect::Make(path, SkIntToScalar(21), 0,
|
| - SkPath1DPathEffect::kRotate_Style));
|
| + paint->setPathEffect(SkPath1DPathEffect::Create(path, SkIntToScalar(21), 0,
|
| + SkPath1DPathEffect::kRotate_Style))->unref();
|
| compose_pe(paint);
|
| }
|
|
|
| @@ -81,21 +83,21 @@
|
| }
|
|
|
| static void discrete_pe(SkPaint* paint) {
|
| - paint->setPathEffect(SkDiscretePathEffect::Make(10, 4));
|
| + paint->setPathEffect(SkDiscretePathEffect::Create(10, 4))->unref();
|
| }
|
|
|
| -static sk_sp<SkPathEffect> MakeTileEffect() {
|
| +static SkPathEffect* MakeTileEffect() {
|
| SkMatrix m;
|
| m.setScale(SkIntToScalar(12), SkIntToScalar(12));
|
|
|
| SkPath path;
|
| path.addCircle(0, 0, SkIntToScalar(5));
|
|
|
| - return SkPath2DPathEffect::Make(m, path);
|
| + return SkPath2DPathEffect::Create(m, path);
|
| }
|
|
|
| static void tile_pe(SkPaint* paint) {
|
| - paint->setPathEffect(MakeTileEffect());
|
| + paint->setPathEffect(MakeTileEffect())->unref();
|
| }
|
|
|
| static const PE_Proc gPE2[] = { fill_pe, discrete_pe, tile_pe };
|
|
|