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

Unified Diff: include/effects/Sk1DPathEffect.h

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 | « include/core/SkXfermode.h ('k') | include/effects/Sk2DPathEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/Sk1DPathEffect.h
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h
index 4ac8f73b266bb5e80cd19950742b2a4a3ca0fa25..ce49460e653733836b8b27441c86adf0a827d185 100644
--- a/include/effects/Sk1DPathEffect.h
+++ b/include/effects/Sk1DPathEffect.h
@@ -52,7 +52,10 @@ public:
@param style how to transform path at each point (based on the current
position and tangent)
*/
- SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
+ static SkPath1DPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar phase,
+ Style style) {
+ return SkNEW_ARGS(SkPath1DPathEffect, (path, advance, phase, style));
+ }
virtual bool filterPath(SkPath*, const SkPath&,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -67,6 +70,11 @@ protected:
virtual SkScalar begin(SkScalar contourLength) const SK_OVERRIDE;
virtual SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
+
private:
SkPath fPath; // copied from constructor
SkScalar fAdvance; // copied from constructor
« no previous file with comments | « include/core/SkXfermode.h ('k') | include/effects/Sk2DPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698