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

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 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 | « samplecode/SamplePathEffects.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePathUtils.cpp
diff --git a/samplecode/SamplePathUtils.cpp b/samplecode/SamplePathUtils.cpp
index 09ab7738e976dd732b365c6369002f90b018c471..503a6eaa25ae6cef22dae3c5f93087a2df78aa91 100644
--- a/samplecode/SamplePathUtils.cpp
+++ b/samplecode/SamplePathUtils.cpp
@@ -65,14 +65,14 @@ protected:
virtual void onDrawContent(SkCanvas* canvas) {
SkScalar intervals[8] = { .5f, .3f, .5f, .3f, .5f, .3f, .5f, .3f };
- SkDashPathEffect dash(intervals, 2, fPhase);
- SkCornerPathEffect corner(.25f);
- SkComposePathEffect compose(&dash, &corner);
+ SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, 2, fPhase));
+ SkAutoTUnref<SkCornerPathEffect> corner(SkCornerPathEffect::Create(.25f));
+ 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
« no previous file with comments | « samplecode/SamplePathEffects.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698