Change patheffect to take a (new) StrokeRec object, which encapsulates the fill
or stroke parameters for a path.
Today, the patheffect only sees if the caller was going to stroke or fill, and
if stroke, it just sees the width. With this change, the effect can see all of the
related parameters (e.g. cap/join/miter). No other change is intended at this
time.
After this change, I hope to use this additional data to allow SkDashPathEffect
to, at times, apply the stroke as part of its effect, which may be much more
efficient than first dashing, and then reading that and stroking it.
Most of these files changed just because of the new parameter to filterPath. The
key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp
Review URL: https://codereview.appspot.com/6250051
git-svn-id: http://skia.googlecode.com/svn/trunk@4048 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h
index 25b6ff3..eafac36 100644
--- a/include/effects/Sk1DPathEffect.h
+++ b/include/effects/Sk1DPathEffect.h
@@ -18,8 +18,7 @@
// This class is not exported to java.
class Sk1DPathEffect : public SkPathEffect {
public:
- // override from SkPathEffect
- virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
+ virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*) SK_OVERRIDE;
protected:
/** Called at the start of each contour, returns the initial offset
@@ -56,8 +55,7 @@
*/
SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
- // override from SkPathEffect
- virtual bool filterPath(SkPath*, const SkPath&, SkScalar* width) SK_OVERRIDE;
+ virtual bool filterPath(SkPath*, const SkPath&, SkStrokeRec*) SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect)
diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h
index 30bbe1a..724fb8f 100644
--- a/include/effects/Sk2DPathEffect.h
+++ b/include/effects/Sk2DPathEffect.h
@@ -19,7 +19,7 @@
Sk2DPathEffect(const SkMatrix& mat);
// overrides
- virtual bool filterPath(SkPath*, const SkPath&, SkScalar* width) SK_OVERRIDE;
+ virtual bool filterPath(SkPath*, const SkPath&, SkStrokeRec*) SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Sk2DPathEffect)
diff --git a/include/effects/SkCornerPathEffect.h b/include/effects/SkCornerPathEffect.h
index 01dae7e..02fe6d9 100644
--- a/include/effects/SkCornerPathEffect.h
+++ b/include/effects/SkCornerPathEffect.h
@@ -27,7 +27,7 @@
// overrides for SkPathEffect
// This method is not exported to java.
- virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
+ virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*) SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
diff --git a/include/effects/SkDashPathEffect.h b/include/effects/SkDashPathEffect.h
index 0c9e53c..87580aa 100644
--- a/include/effects/SkDashPathEffect.h
+++ b/include/effects/SkDashPathEffect.h
@@ -41,9 +41,7 @@
SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase, bool scaleToFit = false);
virtual ~SkDashPathEffect();
- // overrides for SkPathEffect
- // This method is not exported to java.
- virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
+ virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*) SK_OVERRIDE;
// overrides for SkFlattenable
// This method is not exported to java.
diff --git a/include/effects/SkDiscretePathEffect.h b/include/effects/SkDiscretePathEffect.h
index 30d07d3..29fd3c5 100644
--- a/include/effects/SkDiscretePathEffect.h
+++ b/include/effects/SkDiscretePathEffect.h
@@ -24,9 +24,7 @@
*/
SkDiscretePathEffect(SkScalar segLength, SkScalar deviation);
- // overrides for SkPathEffect
- // This method is not exported to java.
- virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
+ virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*) SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect)