diff options
author | bsalomon <bsalomon@google.com> | 2016-05-09 13:02:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-09 13:02:01 -0700 |
commit | 97fd2d42b97104fa32a58d7e7a5b7255913f9c9d (patch) | |
tree | f1984297182430bf5b706e6514d21c20b37d4db7 /src/gpu/GrShape.h | |
parent | 1b4c01c66081cd163535eab21b29a3996b01a6cf (diff) |
Incorporate scale into GrStyle and GrShape
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952383003
Review-Url: https://codereview.chromium.org/1952383003
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r-- | src/gpu/GrShape.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h index f4bd7e581a..d72b17965c 100644 --- a/src/gpu/GrShape.h +++ b/src/gpu/GrShape.h @@ -106,7 +106,14 @@ public: const GrStyle& style() const { return fStyle; } - GrShape applyStyle(GrStyle::Apply apply) { return GrShape(*this, apply); } + /** + * Returns a shape that has either applied the path effect or path effect and stroking + * information from this shape's style to its geometry. Scale is used when approximating the + * output geometry and typically is computed from the view matrix + */ + GrShape applyStyle(GrStyle::Apply apply, SkScalar scale) { + return GrShape(*this, apply, scale); + } bool asRRect(SkRRect* rrect) const { if (Type::kRRect != fType) { @@ -170,14 +177,14 @@ private: }; - /** Constructor used by Apply* functions */ - GrShape(const GrShape& parentShape, GrStyle::Apply); + /** Constructor used by the applyStyle() function */ + GrShape(const GrShape& parentShape, GrStyle::Apply, SkScalar scale); /** * Determines the key we should inherit from the input shape's geometry and style when * we are applying the style to create a new shape. */ - void setInheritedKey(const GrShape& parentShape, GrStyle::Apply); + void setInheritedKey(const GrShape& parentShape, GrStyle::Apply, SkScalar scale); void attemptToReduceFromPath() { SkASSERT(Type::kPath == fType); |