diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-09 18:14:31 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-09 18:14:31 +0000 |
commit | e28b917669fc4677b2f1c0a08c4711b651cbf1a1 (patch) | |
tree | b1f16207d6bdfdb5b073ffb1535fa20f1cc87448 | |
parent | eefe6f1eef1b5cd394853a3f31a92c3c8db62c45 (diff) |
register 1D and 2D patheffects, so they work when serialized (and piperized)
git-svn-id: http://skia.googlecode.com/svn/trunk@2085 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/effects/Sk1DPathEffect.h | 8 | ||||
-rw-r--r-- | include/effects/Sk2DPathEffect.h | 4 | ||||
-rw-r--r-- | src/effects/Sk1DPathEffect.cpp | 5 | ||||
-rw-r--r-- | src/effects/Sk2DPathEffect.cpp | 3 |
4 files changed, 14 insertions, 6 deletions
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h index 8d353393d6..1ba824cb23 100644 --- a/include/effects/Sk1DPathEffect.h +++ b/include/effects/Sk1DPathEffect.h @@ -59,6 +59,10 @@ public: // override from SkPathEffect virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width); + static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { + return SkNEW_ARGS(SkPath1DPathEffect, (buffer)); + } + protected: SkPath1DPathEffect(SkFlattenableReadBuffer& buffer); @@ -74,10 +78,6 @@ private: SkScalar fAdvance; // copied from constructor SkScalar fInitialOffset; // computed from phase Style fStyle; // copied from constructor - - static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { - return SkNEW_ARGS(SkPath1DPathEffect, (buffer)); - } typedef Sk1DPathEffect INHERITED; }; diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h index 7534561caa..22b5dd360b 100644 --- a/include/effects/Sk2DPathEffect.h +++ b/include/effects/Sk2DPathEffect.h @@ -29,6 +29,8 @@ public: // This method is not exported to java. virtual Factory getFactory(); + static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); + protected: /** New virtual, to be overridden by subclasses. This is called once from filterPath, and provides the @@ -57,8 +59,6 @@ private: Sk2DPathEffect(const Sk2DPathEffect&); Sk2DPathEffect& operator=(const Sk2DPathEffect&); - static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); - friend class Sk2DPathEffectBlitter; typedef SkPathEffect INHERITED; }; diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp index bcc77dfa0b..0df8cbd9c1 100644 --- a/src/effects/Sk1DPathEffect.cpp +++ b/src/effects/Sk1DPathEffect.cpp @@ -196,3 +196,8 @@ SkScalar SkPath1DPathEffect::next(SkPath* dst, SkScalar distance, SkPathMeasure& return fAdvance; } +/////////////////////////////////////////////////////////////////////////////// + +static SkFlattenable::Registrar gReg("SkPath1DPathEffect", + SkPath1DPathEffect::CreateProc); + diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp index 37ceabde9b..b205f7042b 100644 --- a/src/effects/Sk2DPathEffect.cpp +++ b/src/effects/Sk2DPathEffect.cpp @@ -100,5 +100,8 @@ SkFlattenable* Sk2DPathEffect::CreateProc(SkFlattenableReadBuffer& buffer) return SkNEW_ARGS(Sk2DPathEffect, (buffer)); } +/////////////////////////////////////////////////////////////////////////////// +static SkFlattenable::Registrar gReg("Sk2DPathEffect", + Sk2DPathEffect::CreateProc); |