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

Unified Diff: gm/dashing.cpp

Issue 166583002: Factory methods for heap-allocated SkPathEffect and SkXfermode objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update experimental/PdfViewer Created 6 years, 10 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 | « gm/dashcubics.cpp ('k') | gm/patheffects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dashing.cpp
diff --git a/gm/dashing.cpp b/gm/dashing.cpp
index fa88e9e0abae4a7795d1cbdea729dc9081264e97..f690852fbda2a9a1215f56499d368956650f4656 100644
--- a/gm/dashing.cpp
+++ b/gm/dashing.cpp
@@ -19,7 +19,7 @@ static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint,
SkIntToScalar(off),
};
- p.setPathEffect(new SkDashPathEffect(intervals, 2, 0))->unref();
+ p.setPathEffect(SkDashPathEffect::Create(intervals, 2, 0))->unref();
canvas->drawLine(0, 0, finalX, 0, p);
}
@@ -155,7 +155,7 @@ protected:
vals[i] = SkIntToScalar(*intervals++);
}
SkScalar phase = vals[0] / 2;
- paint.setPathEffect(new SkDashPathEffect(vals, count, phase))->unref();
+ paint.setPathEffect(SkDashPathEffect::Create(vals, count, phase))->unref();
for (size_t x = 0; x < SK_ARRAY_COUNT(gProc); ++x) {
SkPath path;
@@ -202,7 +202,7 @@ protected:
SkScalar intervals[2] = { dashLength, dashLength };
- p.setPathEffect(new SkDashPathEffect(intervals, 2, phase, false))->unref();
+ p.setPathEffect(SkDashPathEffect::Create(intervals, 2, phase, false))->unref();
SkPoint pts[2];
« no previous file with comments | « gm/dashcubics.cpp ('k') | gm/patheffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698