Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: src/utils/SkDashPathPriv.h

Issue 1805963002: allow one zero length dash (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dash nanobench Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/utils/SkDashPath.cpp ('k') | tests/DashPathEffectTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkDashPathPriv_DEFINED 8 #ifndef SkDashPathPriv_DEFINED
9 #define SkDashPathPriv_DEFINED 9 #define SkDashPathPriv_DEFINED
10 10
11 #include "SkPathEffect.h" 11 #include "SkPathEffect.h"
12 12
13 namespace SkDashPath { 13 namespace SkDashPath {
14 /* 14 /*
15 * Calculates the initialDashLength, initialDashIndex, and intervalLength ba sed on the 15 * Calculates the initialDashLength, initialDashIndex, and intervalLength ba sed on the
16 * inputed phase and intervals. If adjustedPhase is passed in, then the phas e will be 16 * inputed phase and intervals. If adjustedPhase is passed in, then the phas e will be
17 * adjusted to be between 0 and intervalLength. The result will be stored in adjustedPhase. 17 * adjusted to be between 0 and intervalLength. The result will be stored in adjustedPhase.
18 * If adjustedPhase is nullptr then it is assumed phase is already between 0 and intervalLength 18 * If adjustedPhase is nullptr then it is assumed phase is already between 0 and intervalLength
19 *
20 * Caller should have already used ValidDashPath to exclude invalid data.
19 */ 21 */
20 void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count, 22 void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count,
21 SkScalar* initialDashLength, int32_t* initialDashInd ex, 23 SkScalar* initialDashLength, int32_t* initialDashInd ex,
22 SkScalar* intervalLength, SkScalar* adjustedPhase = nullptr); 24 SkScalar* intervalLength, SkScalar* adjustedPhase = nullptr);
23 25
24 bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRe ct*, 26 bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRe ct*,
25 const SkScalar aIntervals[], int32_t count, SkScalar ini tialDashLength,
26 int32_t initialDashIndex, SkScalar intervalLength);
27
28 bool FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRe ct*,
29 const SkPathEffect::DashInfo& info); 27 const SkPathEffect::DashInfo& info);
28
29 /*
30 * Caller should have already used ValidDashPath to exclude invalid data.
31 */
32 bool InternalFilter(SkPath* dst, const SkPath& src, SkStrokeRec* rec,
33 const SkRect* cullRect, const SkScalar aIntervals[],
34 int32_t count, SkScalar initialDashLength, int32_t initi alDashIndex,
35 SkScalar intervalLength);
36
37 bool ValidDashPath(SkScalar phase, const SkScalar intervals[], int32_t count );
30 } 38 }
31 39
32 #endif 40 #endif
OLDNEW
« no previous file with comments | « src/utils/SkDashPath.cpp ('k') | tests/DashPathEffectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698