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

Side by Side Diff: src/utils/SkDashPath.cpp

Issue 1614923002: Add Lua SkXfermode skp scraping support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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
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 #include "SkDashPathPriv.h" 8 #include "SkDashPathPriv.h"
9 #include "SkPathMeasure.h" 9 #include "SkPathMeasure.h"
10 #include "SkStrokeRec.h" 10 #include "SkStrokeRec.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 path->addPoly(pts, SK_ARRAY_COUNT(pts), false); 211 path->addPoly(pts, SK_ARRAY_COUNT(pts), false);
212 } 212 }
213 213
214 private: 214 private:
215 SkPoint fPts[2]; 215 SkPoint fPts[2];
216 SkVector fTangent; 216 SkVector fTangent;
217 SkVector fNormal; 217 SkVector fNormal;
218 SkScalar fPathLength; 218 SkScalar fPathLength;
219 }; 219 };
220 220
221
222 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec , 221 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec ,
223 const SkRect* cullRect, const SkScalar aInterval s[], 222 const SkRect* cullRect, const SkScalar aInterval s[],
224 int32_t count, SkScalar initialDashLength, int32 _t initialDashIndex, 223 int32_t count, SkScalar initialDashLength, int32 _t initialDashIndex,
225 SkScalar intervalLength) { 224 SkScalar intervalLength) {
226 225
227 // we do nothing if the src wants to be filled, or if our dashlength is 0 226 // we do nothing if the src wants to be filled, or if our dashlength is 0
228 if (rec->isFillStyle() || initialDashLength < 0) { 227 if (rec->isFillStyle() || initialDashLength < 0) {
229 return false; 228 return false;
230 } 229 }
231 230
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec , 320 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec ,
322 const SkRect* cullRect, const SkPathEffect::Dash Info& info) { 321 const SkRect* cullRect, const SkPathEffect::Dash Info& info) {
323 SkScalar initialDashLength = 0; 322 SkScalar initialDashLength = 0;
324 int32_t initialDashIndex = 0; 323 int32_t initialDashIndex = 0;
325 SkScalar intervalLength = 0; 324 SkScalar intervalLength = 0;
326 CalcDashParameters(info.fPhase, info.fIntervals, info.fCount, 325 CalcDashParameters(info.fPhase, info.fIntervals, info.fCount,
327 &initialDashLength, &initialDashIndex, &intervalLength); 326 &initialDashLength, &initialDashIndex, &intervalLength);
328 return FilterDashPath(dst, src, rec, cullRect, info.fIntervals, info.fCount, initialDashLength, 327 return FilterDashPath(dst, src, rec, cullRect, info.fIntervals, info.fCount, initialDashLength,
329 initialDashIndex, intervalLength); 328 initialDashIndex, intervalLength);
330 } 329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698