aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-10 12:56:16 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-10 12:56:16 +0000
commit75a0972dd7d0dbc614b9fb81b4450a349c005325 (patch)
tree9146d1fbca0d01d00340f0c8fb0bc412850f0689 /src
parentf1d88064bc56985f22f00a7ad7cf56f9fdceb80f (diff)
move SkStrokePathEffect into hiding for now, as its functionality is rethought.
git-svn-id: http://skia.googlecode.com/svn/trunk@3890 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPathEffect.cpp35
-rw-r--r--src/effects/SkLayerRasterizer.cpp1
-rw-r--r--src/pipe/SkGPipeWrite.cpp1
-rw-r--r--src/ports/SkGlobalInitialization_default.cpp2
4 files changed, 37 insertions, 2 deletions
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp
index bbf6f18a23..8731aedb84 100644
--- a/src/core/SkPathEffect.cpp
+++ b/src/core/SkPathEffect.cpp
@@ -71,6 +71,39 @@ bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src,
#include "SkStroke.h"
+/** \class SkStrokePathEffect
+
+ SkStrokePathEffect simulates stroking inside a patheffect, allowing the
+ caller to have explicit control of when to stroke a path. Typically this is
+ used if the caller wants to stroke before another patheffect is applied
+ (using SkComposePathEffect or SkSumPathEffect).
+ */
+class SkStrokePathEffect : public SkPathEffect {
+public:
+ SkStrokePathEffect(const SkPaint&);
+ SkStrokePathEffect(SkScalar width, SkPaint::Style, SkPaint::Join,
+ SkPaint::Cap, SkScalar miterLimit = -1);
+
+ // overrides
+ virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
+
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStrokePathEffect)
+
+protected:
+ SkStrokePathEffect(SkFlattenableReadBuffer&);
+ virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
+
+private:
+ SkScalar fWidth, fMiter;
+ uint8_t fStyle, fJoin, fCap;
+
+ typedef SkPathEffect INHERITED;
+
+ // illegal
+ SkStrokePathEffect(const SkStrokePathEffect&);
+ SkStrokePathEffect& operator=(const SkStrokePathEffect&);
+};
+
SkStrokePathEffect::SkStrokePathEffect(const SkPaint& paint)
: fWidth(paint.getStrokeWidth()), fMiter(paint.getStrokeMiter()),
fStyle(SkToU8(paint.getStyle())), fJoin(SkToU8(paint.getStrokeJoin())),
@@ -129,6 +162,6 @@ SkStrokePathEffect::SkStrokePathEffect(SkFlattenableReadBuffer& buffer) {
///////////////////////////////////////////////////////////////////////////////
SK_DEFINE_FLATTENABLE_REGISTRAR(SkComposePathEffect)
-SK_DEFINE_FLATTENABLE_REGISTRAR(SkStrokePathEffect)
+//SK_DEFINE_FLATTENABLE_REGISTRAR(SkStrokePathEffect)
SK_DEFINE_FLATTENABLE_REGISTRAR(SkSumPathEffect)
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index 8899b4216a..f3de867291 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/effects/SkLayerRasterizer.cpp
@@ -14,6 +14,7 @@
#include "SkMaskFilter.h"
#include "SkPaint.h"
#include "SkPath.h"
+#include "SkPathEffect.h"
#include "../core/SkRasterClip.h"
#include "SkXfermode.h"
#include <new>
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index b06d40e8d1..08c6f49a39 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -12,6 +12,7 @@
#include "SkData.h"
#include "SkDevice.h"
#include "SkPaint.h"
+#include "SkPathEffect.h"
#include "SkGPipe.h"
#include "SkGPipePriv.h"
#include "SkImageFilter.h"
diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp
index a949c6ed1d..8995d3b1fd 100644
--- a/src/ports/SkGlobalInitialization_default.cpp
+++ b/src/ports/SkGlobalInitialization_default.cpp
@@ -68,7 +68,7 @@ void SkFlattenable::InitializeFlattenables() {
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShape)
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStrokePathEffect)
+// SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStrokePathEffect)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkShape)