Index: src/gpu/GrStrokeInfo.h |
diff --git a/src/gpu/GrStrokeInfo.h b/src/gpu/GrStrokeInfo.h |
index 2bd056ea3cadba0e77d35bb50f42a9f9d0dea3af..dd942c52e96be8ba39fd2f1f3e14c20cd80bdd87 100644 |
--- a/src/gpu/GrStrokeInfo.h |
+++ b/src/gpu/GrStrokeInfo.h |
@@ -44,6 +44,15 @@ public: |
this->init(paint); |
} |
+ GrStrokeInfo& operator=(const GrStrokeInfo& other) { |
+ fStroke = other.fStroke; |
+ fDashInfo = other.fDashInfo; |
+ fDashType = other.fDashType; |
+ fIntervals.reset(other.dashCount()); |
+ memcpy(fIntervals.get(), other.fIntervals.get(), other.dashCount() * sizeof(SkScalar)); |
+ return *this; |
+ } |
+ |
const SkStrokeRec& getStrokeRec() const { return fStroke; } |
SkStrokeRec* getStrokeRecPtr() { return &fStroke; } |
@@ -73,6 +82,8 @@ public: |
return (!fStroke.isFillStyle() && SkPathEffect::kDash_DashType == fDashType); |
} |
+ bool isFillStyle() const { return fStroke.isFillStyle(); } |
+ |
int32_t dashCount() const { |
return fDashInfo.fCount; |
} |
@@ -83,6 +94,14 @@ public: |
const SkPathEffect::DashInfo& getDashInfo() const { return fDashInfo; } |
+ /** Applies the dash to a path, if the stroke info has dashing. |
+ * @return true if the dash ingwas applied (dst and dstStrokeInfo will be modified). |
+ * false if the stroke info did not have dashing. The dst and dstStrokeInfo |
+ * will be unmodified. The stroking in the SkStrokeRec might still |
+ * be applicable. |
+ */ |
+ bool applyDash(SkPath* dst, GrStrokeInfo* dstStrokeInfo, const SkPath& src) const; |
+ |
private: |
void init(const SkPaint& paint) { |