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

Unified Diff: samplecode/SamplePathUtils.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 sampleapp & animator 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
Index: samplecode/SamplePathUtils.cpp
diff --git a/samplecode/SamplePathUtils.cpp b/samplecode/SamplePathUtils.cpp
index 09ab7738e976dd732b365c6369002f90b018c471..5e1ff97c35dcdd81970ce19d60ca356d7ff164cc 100644
--- a/samplecode/SamplePathUtils.cpp
+++ b/samplecode/SamplePathUtils.cpp
@@ -67,12 +67,12 @@ protected:
SkScalar intervals[8] = { .5f, .3f, .5f, .3f, .5f, .3f, .5f, .3f };
SkDashPathEffect dash(intervals, 2, fPhase);
SkCornerPathEffect corner(.25f);
- SkComposePathEffect compose(&dash, &corner);
+ SkAutoTUnref<SkComposePathEffect> compose(SkComposePathEffect::Create(&dash, &corner));
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true); // dashed paint for bitmap
outlinePaint.setStyle(SkPaint::kStroke_Style);
- outlinePaint.setPathEffect(&compose);
+ outlinePaint.setPathEffect(compose);
canvas->scale(10.0f, 10.0f); // scales up

Powered by Google App Engine
This is Rietveld 408576698