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) { |