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

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: Move comments from constructors to factory methods. 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: include/effects/Sk1DPathEffect.h
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h
index 4ac8f73b266bb5e80cd19950742b2a4a3ca0fa25..22ac16c5bfa701a9cba372ef2aedb88a0f3183bf 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;
@@ -60,6 +63,7 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect)
protected:
+ SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
scroggo 2014/02/19 00:37:13 This constructor is used by Android. It would be h
SkPath1DPathEffect(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698