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

Unified Diff: gm/texteffects.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 | « gm/patheffects.cpp ('k') | include/core/SkPathEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texteffects.cpp
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index 094fe7b8a175681c2e39cdf91eac47d5d33c02a9..cf9ec5accc3308be438e3c01bce8e1bd9d44d47e 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -77,7 +77,7 @@ static void r4(SkLayerRasterizer* rast, SkPaint& p) {
static void r5(SkLayerRasterizer* rast, SkPaint& p) {
rast->addLayer(p);
- p.setPathEffect(new SkDiscretePathEffect(SK_Scalar1*4, SK_Scalar1*3))->unref();
+ p.setPathEffect(SkDiscretePathEffect::Create(SK_Scalar1*4, SK_Scalar1*3))->unref();
p.setXfermodeMode(SkXfermode::kSrcOut_Mode);
rast->addLayer(p);
}
@@ -98,7 +98,7 @@ static void r6(SkLayerRasterizer* rast, SkPaint& p) {
static SkPathEffect* MakeDotEffect(SkScalar radius, const SkMatrix& matrix) {
SkPath path;
path.addCircle(0, 0, radius);
- return new SkPath2DPathEffect(matrix, path);
+ return SkPath2DPathEffect::Create(matrix, path);
}
static void r7(SkLayerRasterizer* rast, SkPaint& p) {
@@ -132,7 +132,7 @@ static void r9(SkLayerRasterizer* rast, SkPaint& p) {
SkMatrix lattice;
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
lattice.postRotate(SkIntToScalar(30), 0, 0);
- p.setPathEffect(new SkLine2DPathEffect(SK_Scalar1*2, lattice))->unref();
+ p.setPathEffect(SkLine2DPathEffect::Create(SK_Scalar1*2, lattice))->unref();
p.setXfermodeMode(SkXfermode::kClear_Mode);
rast->addLayer(p);
« no previous file with comments | « gm/patheffects.cpp ('k') | include/core/SkPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698