Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: include/core/SkStrokeRec.h

Issue 1130153002: Fix SkStrokeRec == to report true for all fills (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: the testcase had some doubles Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrPath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | src/gpu/GrPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698