Index: include/core/SkStrokeRec.h |
diff --git a/include/core/SkStrokeRec.h b/include/core/SkStrokeRec.h |
index 00b1fc1fca6d0d1479e3d3e4e2f4d8ce760256d7..b56dacb42cbe94fd4c78981aaa8cab902f50e402 100644 |
--- a/include/core/SkStrokeRec.h |
+++ b/include/core/SkStrokeRec.h |
@@ -95,12 +95,20 @@ public: |
*/ |
void applyToPaint(SkPaint* paint) const; |
- bool operator==(const SkStrokeRec& other) const { |
- return fWidth == other.fWidth && |
- fMiterLimit == other.fMiterLimit && |
- fCap == other.fCap && |
- fJoin == other.fJoin && |
- fStrokeAndFill == other.fStrokeAndFill; |
+ /** |
+ * Compare if two SkStrokeRecs have an equal effect on a path. |
+ * Equal SkStrokeRecs produce equal paths. Equality of produced |
+ * paths does not take the ResScale parameter into account. |
+ */ |
+ bool hasEqualEffect(const SkStrokeRec& other) const { |
+ if (!this->needToApply()) { |
+ return this->getStyle() == other.getStyle(); |
+ } |
+ return fWidth == other.fWidth && |
+ fMiterLimit == other.fMiterLimit && |
+ fCap == other.fCap && |
+ fJoin == other.fJoin && |
+ fStrokeAndFill == other.fStrokeAndFill; |
} |
private: |