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

Unified Diff: src/gpu/GrShape.h

Issue 2046753002: Get segment masks from GrShape. (Closed) Base URL: https://chromium.googlesource.com/skia.git@shapedirandstart
Patch Set: 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 | « no previous file | tests/GrShapeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrShape.h
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h
index 30a1b83bf896c018add3aaff51b7210cb8958922..4ba56061e5158dbd5524deff65a61b6a455c3b00 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).
« no previous file with comments | « no previous file | tests/GrShapeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698