1 /*
2  * Copyright 2014 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkDashPathPriv_DEFINED
9 #define SkDashPathPriv_DEFINED
10 
11 #include "SkPathEffect.h"
12 
13 namespace SkDashPath {
14     /*
15      * Calculates the initialDashLength, initialDashIndex, and intervalLength based on the
16      * inputed phase and intervals. If adjustedPhase is passed in, then the phase will be
17      * adjusted to be between 0 and intervalLength. The result will be stored in adjustedPhase.
18      * If adjustedPhase is NULL then it is assumed phase is already between 0 and intervalLength
19      */
20     void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count,
21                             SkScalar* initialDashLength, int32_t* initialDashIndex,
22                             SkScalar* intervalLength, SkScalar* adjustedPhase = NULL);
23 
24     bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
25                         const SkScalar aIntervals[], int32_t count, SkScalar initialDashLength,
26                         int32_t initialDashIndex, SkScalar intervalLength);
27 
28     bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*,
29                         const SkPathEffect::DashInfo& info);
30 }
31 
32 #endif
33