use common subclass SkPath2DPathEffect, which can be serialized
git-svn-id: http://skia.googlecode.com/svn/trunk@2087 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h
index 22b5dd3..f27a6b3 100644
--- a/include/effects/Sk2DPathEffect.h
+++ b/include/effects/Sk2DPathEffect.h
@@ -10,27 +10,21 @@
#ifndef Sk2DPathEffect_DEFINED
#define Sk2DPathEffect_DEFINED
+#include "SkPath.h"
#include "SkPathEffect.h"
#include "SkMatrix.h"
-// This class is not exported to java.
class Sk2DPathEffect : public SkPathEffect {
public:
Sk2DPathEffect(const SkMatrix& mat);
// overrides
- // This method is not exported to java.
virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
// overrides from SkFlattenable
- // This method is not exported to java.
virtual void flatten(SkFlattenableWriteBuffer&);
-
- // 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
@@ -59,8 +53,34 @@
Sk2DPathEffect(const Sk2DPathEffect&);
Sk2DPathEffect& operator=(const Sk2DPathEffect&);
+ static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
+
friend class Sk2DPathEffectBlitter;
typedef SkPathEffect INHERITED;
};
+class SkPath2DPathEffect : public Sk2DPathEffect {
+public:
+ /**
+ * Stamp the specified path to fill the shape, using the matrix to define
+ * the latice.
+ */
+ SkPath2DPathEffect(const SkMatrix&, const SkPath&);
+
+ static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
+
+protected:
+ SkPath2DPathEffect(SkFlattenableReadBuffer& buffer);
+
+ virtual void flatten(SkFlattenableWriteBuffer&);
+ virtual Factory getFactory();
+ virtual void next(const SkPoint& loc, int u, int v, SkPath* dst);
+
+private:
+ SkPath fPath;
+
+ typedef Sk2DPathEffect INHERITED;
+};
+
+
#endif