aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrShape.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-06-21 08:35:49 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-21 08:35:49 -0700
commit93f66bc3af522fdd2a5315407ba6d3f65c13fd1c (patch)
treeca7007a7ab08f6c7f263c4c734132432fb88024c /src/gpu/GrShape.h
parent9b972c4a1278c16d7237563560710774edb43b3c (diff)
Apply canonicalizations to path GrShapes.
The following canonicalizations of path-backed GrShapes are added: *convex shapes are stored with even/odd (or inv even/odd) fill. *filled paths are closed. *dashed paths ignore inverseness of the fill This will improve the results of queries about the geometry that will be added in a future change. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2067283003 Review-Url: https://codereview.chromium.org/2067283003
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r--src/gpu/GrShape.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h
index 6086537a99..1ed69ba6e8 100644
--- a/src/gpu/GrShape.h
+++ b/src/gpu/GrShape.h
@@ -188,8 +188,11 @@ public:
case Type::kRRect:
out->reset();
out->addRRect(fRRect, fRRectDir, fRRectStart);
+ // Below matches the fill type that attemptToSimplifyPath uses.
if (fRRectIsInverted) {
- out->setFillType(SkPath::kInverseWinding_FillType);
+ out->setFillType(SkPath::kInverseEvenOdd_FillType);
+ } else {
+ out->setFillType(SkPath::kEvenOdd_FillType);
}
break;
case Type::kPath:
@@ -279,7 +282,6 @@ private:
void setInheritedKey(const GrShape& parentShape, GrStyle::Apply, SkScalar scale);
void attemptToSimplifyPath();
-
void attemptToSimplifyRRect();
static constexpr SkPath::Direction kDefaultRRectDir = SkPath::kCW_Direction;
@@ -333,6 +335,8 @@ private:
unsigned fRRectStart;
bool fRRectIsInverted;
SkTLazy<SkPath> fPath;
+ // Gen ID of the original path (fPath may be modified)
+ int32_t fPathGenID = 0;
GrStyle fStyle;
SkAutoSTArray<8, uint32_t> fInheritedKey;
};