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

Unified Diff: samplecode/SamplePathEffects.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/SamplePathEffects.cpp
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index ac77f210de911160b5a00f28b657753e725ea37e..dd1fbfec9b8b1f9a93d4abdbd5bcf88c8ccd5630 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.cpp
@@ -38,14 +38,14 @@ static SkPathEffect* make_pe(int flags) {
path.close();
path.offset(SkIntToScalar(-6), 0);
- SkPathEffect* outer = new SkPath1DPathEffect(path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kRotate_Style);
+ SkPathEffect* outer = SkPath1DPathEffect::Create(path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kRotate_Style);
if (flags == 2)
return outer;
SkPathEffect* inner = new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS));
- SkPathEffect* pe = new SkComposePathEffect(outer, inner);
+ SkPathEffect* pe = SkComposePathEffect::Create(outer, inner);
outer->unref();
inner->unref();
return pe;
@@ -59,10 +59,11 @@ static SkPathEffect* make_warp_pe() {
path.close();
path.offset(SkIntToScalar(-6), 0);
- SkPathEffect* outer = new SkPath1DPathEffect(path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kMorph_Style);
+ SkPathEffect* outer = SkPath1DPathEffect::Create(
+ path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kMorph_Style);
SkPathEffect* inner = new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS));
- SkPathEffect* pe = new SkComposePathEffect(outer, inner);
+ SkPathEffect* pe = SkComposePathEffect::Create(outer, inner);
outer->unref();
inner->unref();
return pe;

Powered by Google App Engine
This is Rietveld 408576698