diff options
author | bsalomon <bsalomon@google.com> | 2016-06-07 06:28:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-07 06:28:51 -0700 |
commit | 06115ee4300ef6756729dfbcb3e2fc70ebf0413a (patch) | |
tree | 718cb9b73a783039927b54beb3a381c686b68d39 /src/gpu/GrShape.h | |
parent | ee295645bd91fcbe1714847c5fe5341759037cc5 (diff) |
Get segment masks from GrShape.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046753002
Review-Url: https://codereview.chromium.org/2046753002
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r-- | src/gpu/GrShape.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h index 30a1b83bf8..4ba56061e5 100644 --- a/src/gpu/GrShape.h +++ b/src/gpu/GrShape.h @@ -196,6 +196,23 @@ public: return false; } + uint32_t segmentMask() const { + switch (fType) { + case Type::kEmpty: + return 0; + case Type::kRRect: + if (fRRect.getType() == SkRRect::kOval_Type) { + return SkPath::kConic_SegmentMask; + } else if (fRRect.getType() == SkRRect::kRect_Type) { + return SkPath::kLine_SegmentMask; + } + return SkPath::kLine_SegmentMask | SkPath::kConic_SegmentMask; + case Type::kPath: + return fPath.get()->getSegmentMasks(); + } + return 0; + } + /** * Gets the size of the key for the shape represented by this GrShape (ignoring its styling). * A negative value is returned if the shape has no key (shouldn't be cached). |