| Index: samplecode/ClockFaceView.cpp
|
| diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
|
| index 11684e11ada34150d462a6e744c7b333512fba64..f5b43fb82f72864cd37bc27320860d999c7d9c7c 100644
|
| --- a/samplecode/ClockFaceView.cpp
|
| +++ b/samplecode/ClockFaceView.cpp
|
| @@ -132,16 +132,16 @@ private:
|
|
|
| SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) { return new InverseFillPE; }
|
|
|
| -static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
|
| +static sk_sp<SkPathEffect> makepe(float interp, SkTDArray<SkPoint>* pts) {
|
| SkMatrix lattice;
|
| SkScalar rad = 3 + SkIntToScalar(4) * (1 - interp);
|
| lattice.setScale(rad*2, rad*2, 0, 0);
|
| lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
|
| - return new Dot2DPathEffect(rad, lattice, pts);
|
| + return sk_make_sp<Dot2DPathEffect>(rad, lattice, pts);
|
| }
|
|
|
| static void r7(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p, SkScalar interp) {
|
| - p.setPathEffect(makepe(SkScalarToFloat(interp), nullptr))->unref();
|
| + p.setPathEffect(makepe(SkScalarToFloat(interp), nullptr));
|
| rastBuilder->addLayer(p);
|
| #if 0
|
| p.setPathEffect(new InverseFillPE())->unref();
|
| @@ -201,7 +201,7 @@ protected:
|
|
|
| static void drawdots(SkCanvas* canvas, const SkPaint& orig) {
|
| SkTDArray<SkPoint> pts;
|
| - SkPathEffect* pe = makepe(0, &pts);
|
| + auto pe = makepe(0, &pts);
|
|
|
| SkStrokeRec rec(SkStrokeRec::kFill_InitStyle);
|
| SkPath path, dstPath;
|
| @@ -212,8 +212,7 @@ protected:
|
| p.setAntiAlias(true);
|
| p.setStrokeWidth(10);
|
| p.setColor(SK_ColorRED);
|
| - canvas->drawPoints(SkCanvas::kPoints_PointMode, pts.count(), pts.begin(),
|
| - p);
|
| + canvas->drawPoints(SkCanvas::kPoints_PointMode, pts.count(), pts.begin(), p);
|
| }
|
|
|
| virtual void onDraw(SkCanvas* canvas) {
|
|
|