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); |
} |