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

Unified Diff: src/core/SkStroke.cpp

Issue 183683010: fix the error that path is inversed for stroke and strokeAndFill styles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update unittest EmptyPath accordingly Created 6 years, 8 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 | « src/core/SkDraw.cpp ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStroke.cpp
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index b138c326bab497c96429ed1d111ff57954c8ab0d..7d8d707752e942982ce51f01af4e7eebe256249b 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -562,8 +562,9 @@ void SkStroke::strokePath(const SkPath& src, SkPath* dst) const {
SkPath::Direction dir;
if (src.isRect(&isClosed, &dir) && isClosed) {
this->strokeRect(src.getBounds(), dst, dir);
- // our answer should preserve the inverseness of the src
- if (src.isInverseFillType()) {
+ // our answer should preserve the inverseness of the src, but the
+ // rect should not be inverse-stroked.
+ if (src.isInverseFillType() && fWidth < 0) {
SkASSERT(!dst->isInverseFillType());
dst->toggleInverseFillType();
}
@@ -646,8 +647,9 @@ DONE:
#endif
}
- // our answer should preserve the inverseness of the src
- if (src.isInverseFillType()) {
+ // our answer should preserve the inverseness of the src, but the path
+ // should not be inverse-stroked.
+ if (src.isInverseFillType() && fWidth < 0) {
SkASSERT(!dst->isInverseFillType());
dst->toggleInverseFillType();
}
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698