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

Unified Diff: include/core/SkPathEffect.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 | « gm/texteffects.cpp ('k') | include/core/SkXfermode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPathEffect.h
diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h
index 3f38f3a101a52e0889662f8ed38ab192ae0b99be..86ccf86a9223eedb59dfb7361102bfb067177868 100644
--- a/include/core/SkPathEffect.h
+++ b/include/core/SkPathEffect.h
@@ -31,8 +31,6 @@ class SK_API SkPathEffect : public SkFlattenable {
public:
SK_DECLARE_INST_COUNT(SkPathEffect)
- SkPathEffect() {}
-
/**
* Given a src path (input) and a stroke-rec (input and output), apply
* this effect to the src path, returning the new path in dst, and return
@@ -109,6 +107,7 @@ public:
SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect)
protected:
+ SkPathEffect() {}
SkPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
private:
@@ -127,10 +126,10 @@ private:
*/
class SkPairPathEffect : public SkPathEffect {
public:
- SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
virtual ~SkPairPathEffect();
protected:
+ SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
SkPairPathEffect(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
@@ -153,8 +152,9 @@ public:
The reference counts for outer and inner are both incremented in the constructor,
and decremented in the destructor.
*/
- SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
- : INHERITED(outer, inner) {}
+ static SkComposePathEffect* Create(SkPathEffect* outer, SkPathEffect* inner) {
+ return SkNEW_ARGS(SkComposePathEffect, (outer, inner));
+ }
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -164,6 +164,12 @@ public:
protected:
SkComposePathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
+ : INHERITED(outer, inner) {}
+
private:
// illegal
SkComposePathEffect(const SkComposePathEffect&);
@@ -184,8 +190,9 @@ public:
The reference counts for first and second are both incremented in the constructor,
and decremented in the destructor.
*/
- SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
- : INHERITED(first, second) {}
+ static SkSumPathEffect* Create(SkPathEffect* first, SkPathEffect* second) {
+ return SkNEW_ARGS(SkSumPathEffect, (first, second));
+ }
virtual bool filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -195,6 +202,12 @@ public:
protected:
SkSumPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
+ : INHERITED(first, second) {}
+
private:
// illegal
SkSumPathEffect(const SkSumPathEffect&);
« no previous file with comments | « gm/texteffects.cpp ('k') | include/core/SkXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698