diff options
author | bsalomon <bsalomon@google.com> | 2016-05-11 15:15:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 15:15:56 -0700 |
commit | 7c73a53894927d222d4aceed96893daae8ea14f1 (patch) | |
tree | 1b29cfabc484e6089ad85b745321105296840c24 /src/gpu/GrShape.h | |
parent | 93a379bd4d6b30d86c270b879cf172d80172a72b (diff) |
Add isEmpty() query to GrShape and improve comments.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1971613004
Review-Url: https://codereview.chromium.org/1971613004
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r-- | src/gpu/GrShape.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h index d72b17965c..81684e8e2f 100644 --- a/src/gpu/GrShape.h +++ b/src/gpu/GrShape.h @@ -115,6 +115,7 @@ public: return GrShape(*this, apply, scale); } + /** Returns the unstyled geometry as a rrect if possible. */ bool asRRect(SkRRect* rrect) const { if (Type::kRRect != fType) { return false; @@ -125,6 +126,7 @@ public: return true; } + /** Returns the unstyled geometry as a path. */ void asPath(SkPath* out) const { switch (fType) { case Type::kEmpty: @@ -141,8 +143,14 @@ public: } /** - * 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). + * Returns whether the geometry is empty. Note that applying the style could produce a + * non-empty shape. + */ + bool isEmpty() const { return Type::kEmpty == fType; } + + /** + * Is it known that the unstyled geometry 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) { |