diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-31 13:27:15 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-31 18:14:21 +0000 |
commit | d5a3f7f9673a152928332a38e53a5fc55f590f40 (patch) | |
tree | 044a846a2f3755e5bfa47ea22335c9df61b10d64 /src/gpu/GrShape.h | |
parent | 5d303ed44b611708784f7b05cfa35a270c8d0c09 (diff) |
Add a GrShape::Type value for an inverted empty path
Change-Id: Ib34a608db07a2ff1d7bdfbd96867fa5ff0ac9782
Reviewed-on: https://skia-review.googlesource.com/41540
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r-- | src/gpu/GrShape.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h index 074278cd86..5226c239cd 100644 --- a/src/gpu/GrShape.h +++ b/src/gpu/GrShape.h @@ -176,6 +176,10 @@ public: case Type::kEmpty: out->reset(); break; + case Type::kInvertedEmpty: + out->reset(); + out->setFillType(kDefaultPathInverseFillType); + break; case Type::kRRect: out->reset(); out->addRRect(fRRectData.fRRect, fRRectData.fDir, fRRectData.fStart); @@ -204,9 +208,9 @@ public: /** * Returns whether the geometry is empty. Note that applying the style could produce a - * non-empty shape. + * non-empty shape. It also may have an inverse fill. */ - bool isEmpty() const { return Type::kEmpty == fType; } + bool isEmpty() const { return Type::kEmpty == fType || Type::kInvertedEmpty == fType; } /** * Gets the bounds of the geometry without reflecting the shape's styling. This ignores @@ -229,6 +233,8 @@ public: switch (fType) { case Type::kEmpty: return true; + case Type::kInvertedEmpty: + return true; case Type::kRRect: return true; case Type::kLine: @@ -251,6 +257,9 @@ public: case Type::kEmpty: ret = false; break; + case Type::kInvertedEmpty: + ret = true; + break; case Type::kRRect: ret = fRRectData.fInverted; break; @@ -288,6 +297,8 @@ public: switch (fType) { case Type::kEmpty: return true; + case Type::kInvertedEmpty: + return true; case Type::kRRect: return true; case Type::kLine: @@ -303,6 +314,8 @@ public: switch (fType) { case Type::kEmpty: return 0; + case Type::kInvertedEmpty: + return 0; case Type::kRRect: if (fRRectData.fRRect.getType() == SkRRect::kOval_Type) { return SkPath::kConic_SegmentMask; @@ -336,6 +349,7 @@ public: private: enum class Type { kEmpty, + kInvertedEmpty, kRRect, kLine, kPath, |