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

Unified Diff: include/effects/Sk2DPathEffect.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/effects/Sk1DPathEffect.h ('k') | include/effects/SkAvoidXfermode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/Sk2DPathEffect.h
diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h
index 859b5cd95292f96f6ec5021e344b22b8071553a9..f037e335085674ae3108d8626e563b1e30056ccb 100644
--- a/include/effects/Sk2DPathEffect.h
+++ b/include/effects/Sk2DPathEffect.h
@@ -14,7 +14,9 @@
class SK_API Sk2DPathEffect : public SkPathEffect {
public:
- Sk2DPathEffect(const SkMatrix& mat);
+ static Sk2DPathEffect* Create(const SkMatrix& mat) {
+ return SkNEW_ARGS(Sk2DPathEffect, (mat));
+ }
virtual bool filterPath(SkPath*, const SkPath&,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -44,6 +46,11 @@ protected:
Sk2DPathEffect(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ Sk2DPathEffect(const SkMatrix& mat);
+
private:
SkMatrix fMatrix, fInverse;
bool fMatrixIsInvertible;
@@ -58,8 +65,9 @@ private:
class SK_API SkLine2DPathEffect : public Sk2DPathEffect {
public:
- SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix)
- : Sk2DPathEffect(matrix), fWidth(width) {}
+ static SkLine2DPathEffect* Create(SkScalar width, const SkMatrix& matrix) {
+ return SkNEW_ARGS(SkLine2DPathEffect, (width, matrix));
+ }
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -73,6 +81,12 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix)
+ : Sk2DPathEffect(matrix), fWidth(width) {}
+
private:
SkScalar fWidth;
@@ -85,7 +99,9 @@ public:
* Stamp the specified path to fill the shape, using the matrix to define
* the latice.
*/
- SkPath2DPathEffect(const SkMatrix&, const SkPath&);
+ static SkPath2DPathEffect* Create(const SkMatrix& matrix, const SkPath& path) {
+ return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path));
+ }
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect)
@@ -95,6 +111,11 @@ protected:
virtual void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkPath2DPathEffect(const SkMatrix&, const SkPath&);
+
private:
SkPath fPath;
« no previous file with comments | « include/effects/Sk1DPathEffect.h ('k') | include/effects/SkAvoidXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698