diff options
author | bsalomon <bsalomon@google.com> | 2016-09-21 08:26:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-21 08:26:57 -0700 |
commit | 67fa4e31d885acf74514527a2cc3ed759c05d3c4 (patch) | |
tree | e9137e4ae93d2d93530352a281ac4c1ea1a36853 /src/core | |
parent | 8eb43e5f63306a22570b977bbb69e4ec78432d24 (diff) |
Make GrShape compute keys for short paths from path data instead of using the gen id.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357643002
Review-Url: https://codereview.chromium.org/2357643002
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPathPriv.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/SkPathPriv.h b/src/core/SkPathPriv.h index 60b0f2a155..029cb759de 100644 --- a/src/core/SkPathPriv.h +++ b/src/core/SkPathPriv.h @@ -98,6 +98,29 @@ public: */ static void CreateDrawArcPath(SkPath* path, const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, bool isFillNoPathEffect); + + /** + * Returns a pointer to the verb data. Note that the verbs are stored backwards in memory and + * thus the returned pointer is the last verb. + */ + static const uint8_t* VerbData(const SkPath& path) { + return path.fPathRef->verbsMemBegin(); + } + + /** Returns a raw pointer to the path points */ + static const SkPoint* PointData(const SkPath& path) { + return path.fPathRef->points(); + } + + /** Returns the number of conic weights in the path */ + static int ConicWeightCnt(const SkPath& path) { + return path.fPathRef->countWeights(); + } + + /** Returns a raw pointer to the path conic weights. */ + static const SkScalar* ConicWeightData(const SkPath& path) { + return path.fPathRef->conicWeights(); + } }; #endif |