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

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

Issue 1608353002: resolution dependent path measure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment 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
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | no next file » | 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 #include "SkDashPathPriv.h" 8 #include "SkDashPathPriv.h"
9 #include "SkPathMeasure.h" 9 #include "SkPathMeasure.h"
10 #include "SkStrokeRec.h" 10 #include "SkStrokeRec.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 SkPath cullPathStorage; 236 SkPath cullPathStorage;
237 const SkPath* srcPtr = &src; 237 const SkPath* srcPtr = &src;
238 if (cull_path(src, *rec, cullRect, intervalLength, &cullPathStorage)) { 238 if (cull_path(src, *rec, cullRect, intervalLength, &cullPathStorage)) {
239 srcPtr = &cullPathStorage; 239 srcPtr = &cullPathStorage;
240 } 240 }
241 241
242 SpecialLineRec lineRec; 242 SpecialLineRec lineRec;
243 bool specialLine = lineRec.init(*srcPtr, dst, rec, count >> 1, intervalLengt h); 243 bool specialLine = lineRec.init(*srcPtr, dst, rec, count >> 1, intervalLengt h);
244 244
245 SkPathMeasure meas(*srcPtr, false); 245 SkPathMeasure meas(*srcPtr, false, rec->getResScale());
246 246
247 do { 247 do {
248 bool skipFirstSegment = meas.isClosed(); 248 bool skipFirstSegment = meas.isClosed();
249 bool addedSegment = false; 249 bool addedSegment = false;
250 SkScalar length = meas.getLength(); 250 SkScalar length = meas.getLength();
251 int index = initialDashIndex; 251 int index = initialDashIndex;
252 252
253 // Since the path length / dash length ratio may be arbitrarily large, w e can exert 253 // Since the path length / dash length ratio may be arbitrarily large, w e can exert
254 // significant memory pressure while attempting to build the filtered pa th. To avoid this, 254 // significant memory pressure while attempting to build the filtered pa th. To avoid this,
255 // we simply give up dashing beyond a certain threshold. 255 // we simply give up dashing beyond a certain threshold.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec , 321 bool SkDashPath::FilterDashPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec ,
322 const SkRect* cullRect, const SkPathEffect::Dash Info& info) { 322 const SkRect* cullRect, const SkPathEffect::Dash Info& info) {
323 SkScalar initialDashLength = 0; 323 SkScalar initialDashLength = 0;
324 int32_t initialDashIndex = 0; 324 int32_t initialDashIndex = 0;
325 SkScalar intervalLength = 0; 325 SkScalar intervalLength = 0;
326 CalcDashParameters(info.fPhase, info.fIntervals, info.fCount, 326 CalcDashParameters(info.fPhase, info.fIntervals, info.fCount,
327 &initialDashLength, &initialDashIndex, &intervalLength); 327 &initialDashLength, &initialDashIndex, &intervalLength);
328 return FilterDashPath(dst, src, rec, cullRect, info.fIntervals, info.fCount, initialDashLength, 328 return FilterDashPath(dst, src, rec, cullRect, info.fIntervals, info.fCount, initialDashLength,
329 initialDashIndex, intervalLength); 329 initialDashIndex, intervalLength);
330 } 330 }
OLDNEW
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698