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

Unified Diff: src/gpu/GrShape.cpp

Issue 2051263003: Fix GrShape to preserve inverseness of rrects for strokes but not dashes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@strokeinv
Patch Set: Address comment Created 4 years, 6 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/gpu/GrShape.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrShape.cpp
diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp
index 11b2d38971b8faf37686630d16642338a42b69fc..7be7e7ad041931a04316b5aeaa2a0d77986a4f4d 100644
--- a/src/gpu/GrShape.cpp
+++ b/src/gpu/GrShape.cpp
@@ -281,16 +281,16 @@ GrShape::GrShape(const GrShape& parent, GrStyle::Apply apply, SkScalar scale) {
static inline bool rrect_path_is_inverse_filled(const SkPath& path, const SkStrokeRec& strokeRec,
const SkPathEffect* pe) {
- // Dashing doesn't use the path fill type. Dashing only works with stroking
+ // This is currently imitating the questionable behavior of the sw-rasterizer. Inverseness is
+ // respected for stroking but not dashing + stroking. (We make no assumptions about arbitrary
+ // path effects and preserve the path's inverseness.)
+ // skbug.com/5421
if (pe && pe->asADash(nullptr)) {
- pe = nullptr;
- }
-
- SkStrokeRec::Style style = strokeRec.getStyle();
- if (!pe && (SkStrokeRec::kStroke_Style == style || SkStrokeRec::kHairline_Style == style)) {
- // stroking ignores the path fill rule.
+ SkDEBUGCODE(SkStrokeRec::Style style = strokeRec.getStyle();)
+ SkASSERT(SkStrokeRec::kStroke_Style == style || SkStrokeRec::kHairline_Style == style);
return false;
}
+
return path.isInverseFillType();
}
« no previous file with comments | « src/gpu/GrShape.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698