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

Unified Diff: src/gpu/GrShape.h

Issue 1949193002: Make cap only affect the keys of GrShapes that are possibly-open (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: due Created 4 years, 7 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 | src/gpu/GrShape.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 efc28cf73719718289e670a6a279ebc23555ac61..f4bd7e581a44ffc7b3a0f6dada7a01cc47db06cb 100644
--- a/src/gpu/GrShape.h
+++ b/src/gpu/GrShape.h
@@ -120,6 +120,9 @@ public:
void asPath(SkPath* out) const {
switch (fType) {
+ case Type::kEmpty:
+ out->reset();
+ break;
case Type::kRRect:
out->reset();
out->addRRect(fRRect);
@@ -127,10 +130,23 @@ public:
case Type::kPath:
*out = *fPath.get();
break;
+ }
+ }
+
+ /**
+ * Is it known that the shape has no unclosed contours. This means that it will not have
+ * any caps if stroked (modulo the effect of any path effect).
+ */
+ bool knownToBeClosed() const {
+ switch (fType) {
case Type::kEmpty:
- out->reset();
- break;
+ return true;
+ case Type::kRRect:
+ return true;
+ case Type::kPath:
+ return false;
}
+ return false;
}
/**
« no previous file with comments | « no previous file | src/gpu/GrShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698