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

Unified Diff: src/gpu/GrShape.h

Issue 2055253002: Add control over whether lines are special cased in SkDashPath. Disable when called from GrShape. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update comments 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 | 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 3efb66fd6b8522e396a7b3173adcd40d2e058504..93896ce3f0a532cfcfd71a41a3610e32b2060505 100644
--- a/src/gpu/GrShape.h
+++ b/src/gpu/GrShape.h
@@ -168,6 +168,17 @@ public:
return true;
}
+ /**
+ * If the unstyled shape is a straight line segment, returns true and sets pts to the endpoints.
+ * An inverse filled line path is still considered a line.
+ */
+ bool asLine(SkPoint pts[2]) const {
+ if (fType != Type::kPath) {
+ return false;
+ }
+ return fPath.get()->isLine(pts);
+ }
+
/** Returns the unstyled geometry as a path. */
void asPath(SkPath* out) const {
switch (fType) {
« 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