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

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 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/SampleAvoid.cpp ('k') | samplecode/SamplePathUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePathEffects.cpp
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index ac77f210de911160b5a00f28b657753e725ea37e..2a1a49b9495bd15ffc555f764df00bfd4cf686d7 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.cpp
@@ -29,7 +29,7 @@ static const int gXY[] = {
static SkPathEffect* make_pe(int flags) {
if (flags == 1)
- return new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS));
+ return SkCornerPathEffect::Create(SkIntToScalar(CORNER_RADIUS));
SkPath path;
path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1]));
@@ -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* inner = SkCornerPathEffect::Create(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* inner = new SkCornerPathEffect(SkIntToScalar(CORNER_RADIUS));
+ SkPathEffect* outer = SkPath1DPathEffect::Create(
+ path, SkIntToScalar(12), gPhase, SkPath1DPathEffect::kMorph_Style);
+ SkPathEffect* inner = SkCornerPathEffect::Create(SkIntToScalar(CORNER_RADIUS));
- SkPathEffect* pe = new SkComposePathEffect(outer, inner);
+ SkPathEffect* pe = SkComposePathEffect::Create(outer, inner);
outer->unref();
inner->unref();
return pe;
« no previous file with comments | « samplecode/SampleAvoid.cpp ('k') | samplecode/SamplePathUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698