aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-21 12:29:05 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-21 12:29:05 +0000
commit10296ccb6a63c65b2e60733a929bf15d8bf94309 (patch)
tree74ffe5dad3e9a659488aa4ce58c248693190aa37 /include/core
parent4fa6694c587b3830932429766c99d08c8dd9b723 (diff)
add segment types query to SkPath (i.e. does it have any quads)
git-svn-id: http://skia.googlecode.com/svn/trunk@2292 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPath.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index e8aeb4bd37..c3bfd8e0cf 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -569,6 +569,19 @@ public:
this->setLastPt(p.fX, p.fY);
}
+ enum SegmentMask {
+ kLine_SegmentMask = 1 << 0,
+ kQuad_SegmentMask = 1 << 1,
+ kCubic_SegmentMask = 1 << 2
+ };
+
+ /**
+ * Returns a mask, where each bit corresponding to a SegmentMask is
+ * set if the path contains 1 or more segments of that type.
+ * Returns 0 for an empty path (no segments).
+ */
+ uint32_t getSegmentMasks() const { return fSegmentMask; }
+
enum Verb {
kMove_Verb, //!< iter.next returns 1 point
kLine_Verb, //!< iter.next returns 2 points
@@ -642,8 +655,9 @@ private:
SkTDArray<SkPoint> fPts;
SkTDArray<uint8_t> fVerbs;
mutable SkRect fBounds;
- mutable uint8_t fBoundsIsDirty;
uint8_t fFillType;
+ uint8_t fSegmentMask;
+ mutable uint8_t fBoundsIsDirty;
mutable uint8_t fConvexity;
#ifdef ANDROID
uint32_t fGenerationID;