aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStyle.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-05-09 13:02:01 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-09 13:02:01 -0700
commit97fd2d42b97104fa32a58d7e7a5b7255913f9c9d (patch)
treef1984297182430bf5b706e6514d21c20b37d4db7 /src/gpu/GrStyle.h
parent1b4c01c66081cd163535eab21b29a3996b01a6cf (diff)
Incorporate scale into GrStyle and GrShape
Diffstat (limited to 'src/gpu/GrStyle.h')
-rw-r--r--src/gpu/GrStyle.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
index 2ca037a463..6166b56fb7 100644
--- a/src/gpu/GrStyle.h
+++ b/src/gpu/GrStyle.h
@@ -60,7 +60,7 @@ public:
* either reflect just the path effect (if one) or the path effect and the strokerec. Note
* that a simple fill has a zero sized key.
*/
- static int KeySize(const GrStyle& , Apply, uint32_t flags = 0);
+ static int KeySize(const GrStyle&, Apply, uint32_t flags = 0);
/**
* Writes a unique key for the style into the provided buffer. This function assumes the buffer
@@ -69,7 +69,7 @@ public:
* for just dash application followed by the key for the remaining SkStrokeRec is the same as
* the key for applying dashing and SkStrokeRec all at once.
*/
- static void WriteKey(uint32_t*, const GrStyle&, Apply, uint32_t flags = 0);
+ static void WriteKey(uint32_t*, const GrStyle&, Apply, SkScalar scale, uint32_t flags = 0);
GrStyle() : GrStyle(SkStrokeRec::kFill_InitStyle) {}
@@ -135,18 +135,22 @@ public:
/**
* Applies just the path effect and returns remaining stroke information. This will fail if
- * there is no path effect. dst may or may not have been overwritten on failure.
+ * there is no path effect. dst may or may not have been overwritten on failure. Scale controls
+ * geometric approximations made by the path effect. It is typically computed from the view
+ * matrix.
*/
bool SK_WARN_UNUSED_RESULT applyPathEffectToPath(SkPath* dst, SkStrokeRec* remainingStoke,
- const SkPath& src) const;
+ const SkPath& src, SkScalar scale) const;
- /** If this succeeds then the result path should be filled or hairlined as indicated by the
- returned SkStrokeRec::InitStyle value. Will fail if there is no path effect and the
- strokerec doesn't change the geometry. When this fails the outputs may or may not have
- been overwritten.
- */
+ /**
+ * If this succeeds then the result path should be filled or hairlined as indicated by the
+ * returned SkStrokeRec::InitStyle value. Will fail if there is no path effect and the
+ * strokerec doesn't change the geometry. When this fails the outputs may or may not have
+ * been overwritten. Scale controls geometric approximations made by the path effect and
+ * stroker. It is typically computed from the view matrix.
+ */
bool SK_WARN_UNUSED_RESULT applyToPath(SkPath* dst, SkStrokeRec::InitStyle* fillOrHairline,
- const SkPath& src) const;
+ const SkPath& src, SkScalar scale) const;
/** Given bounds of a path compute the bounds of path with the style applied. */
void adjustBounds(SkRect* dst, const SkRect& src) const {