aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/SkDashPathPriv.h
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-03-18 04:44:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-18 04:44:23 -0700
commit5e1a24808415df2748822e8082e21a361362cdfe (patch)
tree84ae073681487073f6ed1b0ae3e7f1c84f4ac9ce /src/utils/SkDashPathPriv.h
parent05849018c85403a34b88819db1c4bcf713b70a2b (diff)
allow one zero length dash
If the constructed stroke that represents a dash has a single dash of length zero, and the end cap is square or round, draw the cap. The old code initialized the initial dash length to zero, making it ambiguous whether the first length is zero or not. R=robertphillips@google.com BUG=583299 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1805963002 Review URL: https://codereview.chromium.org/1805963002
Diffstat (limited to 'src/utils/SkDashPathPriv.h')
-rw-r--r--src/utils/SkDashPathPriv.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/utils/SkDashPathPriv.h b/src/utils/SkDashPathPriv.h
index 7453dcec82..54bf9a4870 100644
--- a/src/utils/SkDashPathPriv.h
+++ b/src/utils/SkDashPathPriv.h
@@ -16,17 +16,25 @@ namespace SkDashPath {
* inputed phase and intervals. If adjustedPhase is passed in, then the phase will be
* adjusted to be between 0 and intervalLength. The result will be stored in adjustedPhase.
* If adjustedPhase is nullptr then it is assumed phase is already between 0 and intervalLength
+ *
+ * Caller should have already used ValidDashPath to exclude invalid data.
*/
void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count,
SkScalar* initialDashLength, int32_t* initialDashIndex,
SkScalar* intervalLength, SkScalar* adjustedPhase = nullptr);
bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
- const SkScalar aIntervals[], int32_t count, SkScalar initialDashLength,
- int32_t initialDashIndex, SkScalar intervalLength);
-
- bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
const SkPathEffect::DashInfo& info);
+
+ /*
+ * Caller should have already used ValidDashPath to exclude invalid data.
+ */
+ bool InternalFilter(SkPath* dst, const SkPath& src, SkStrokeRec* rec,
+ const SkRect* cullRect, const SkScalar aIntervals[],
+ int32_t count, SkScalar initialDashLength, int32_t initialDashIndex,
+ SkScalar intervalLength);
+
+ bool ValidDashPath(SkScalar phase, const SkScalar intervals[], int32_t count);
}
#endif