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

Unified Diff: include/core/SkPath.h

Issue 140953003: add alternative to isRect named asRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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/core/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 9b3f281ea9508bb08f07966dbb21cabb37af9b04..fa13039fe5569b98ef2e85a0871cb290a06a4abd 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -555,6 +555,24 @@ public:
return computedDir == dir;
}
+ enum PathAsRect {
+ /** The path can not draw the same as its bounds. */
+ kNone_PathAsRect,
+ /** The path draws the same as its bounds when stroked or filled. */
+ kStroke_PathAsRect,
+ /** The path draws the same as its bounds when filled. */
+ kFill_PathAsRect,
+ };
+
+ /** Returns kFill_PathAsRect or kStroke_PathAsRect if the path is a rect. If
reed1 2014/01/23 18:34:20 I wonder if we want a different overall descriptio
caryclark 2014/01/23 19:03:23 Done.
+ so, and direction is not null, sets the direction of the contour. If the
+ path is not a rect, returns kNone_PathAsRect and ignores direction.
+
+ @param direction If not null, set to the contour's direction when it is a rect
+ @return the path's PathAsRect type
+ */
+ PathAsRect asRect(Direction* direction = NULL) const;
+
/** Returns true if the path specifies a rectangle. If so, and if isClosed is
not null, set isClosed to true if the path is closed. Also, if returning true
and direction is not null, return the rect direction. If the path does not
« no previous file with comments | « no previous file | src/core/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698