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

Unified Diff: gm/dashing.cpp

Issue 1817543002: Revert of switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « gm/dashcubics.cpp ('k') | gm/pathcontourstart.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 6cb1dea66cc62246920f0f398e6efabac9fec858..c728d15a1a36a72429dcef2e55334e4ad6eff3b8 100644
--- a/gm/dashing.cpp
+++ b/gm/dashing.cpp
@@ -21,7 +21,8 @@
SkIntToScalar(off),
};
- p.setPathEffect(SkDashPathEffect::Make(intervals, 2, phase));
+ SkAutoTUnref<SkPathEffect> effect(SkDashPathEffect::Create(intervals, 2, phase));
+ p.setPathEffect(effect);
canvas->drawLine(startX, startY, finalX, finalY, p);
}
@@ -174,7 +175,7 @@
vals[i] = SkIntToScalar(*intervals++);
}
SkScalar phase = vals[0] / 2;
- paint.setPathEffect(SkDashPathEffect::Make(vals, count, phase));
+ paint.setPathEffect(SkDashPathEffect::Create(vals, count, phase))->unref();
for (size_t x = 0; x < SK_ARRAY_COUNT(gProc); ++x) {
SkPath path;
@@ -222,7 +223,7 @@
SkScalar intervals[2] = { dashLength, dashLength };
- p.setPathEffect(SkDashPathEffect::Make(intervals, 2, phase));
+ p.setPathEffect(SkDashPathEffect::Create(intervals, 2, phase))->unref();
SkPoint pts[2];
@@ -498,7 +499,7 @@
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(1);
const SkScalar intervals[] = { 1, 1 };
- p.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));
+ p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref();
canvas->drawPath(lines, p);
}
@@ -509,7 +510,7 @@
p.setStrokeWidth(80);
const SkScalar intervals[] = { 2, 2 };
- p.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));
+ p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref();
canvas->drawRect(SkRect::MakeXYWH(-10000, 100, 20000, 20), p);
}
@@ -539,7 +540,7 @@
p.setARGB(0xff, 0xbb, 0x00, 0x00);
sk_tool_utils::set_portable_typeface(&p);
const SkScalar intervals[] = { 12, 12 };
- p.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));
+ p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref();
canvas->drawText("Sausages", 8, 10, 90, p);
canvas->drawLine(8, 120, 456, 120, p);
}
« no previous file with comments | « gm/dashcubics.cpp ('k') | gm/pathcontourstart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698