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

Side by Side Diff: src/effects/SkDashPathEffect.cpp

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice Created 5 years, 7 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/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkDashPathEffect.h" 8 #include "SkDashPathEffect.h"
9 9
10 #include "SkDashPathPriv.h" 10 #include "SkDashPathPriv.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 len2 -= clampedInitialDashLength; 241 len2 -= clampedInitialDashLength;
242 } 242 }
243 len2 -= fIntervals[1]; // also skip first space 243 len2 -= fIntervals[1]; // also skip first space
244 if (len2 < 0) { 244 if (len2 < 0) {
245 len2 = 0; 245 len2 = 0;
246 } 246 }
247 } else { 247 } else {
248 len2 -= clampedInitialDashLength; // skip initial partial empty 248 len2 -= clampedInitialDashLength; // skip initial partial empty
249 } 249 }
250 } 250 }
251 int numMidPoints = SkScalarFloorToInt(SkScalarDiv(len2, fIntervalLength) ); 251 int numMidPoints = SkScalarFloorToInt(len2 / fIntervalLength);
252 results->fNumPoints += numMidPoints; 252 results->fNumPoints += numMidPoints;
253 len2 -= numMidPoints * fIntervalLength; 253 len2 -= numMidPoints * fIntervalLength;
254 bool partialLast = false; 254 bool partialLast = false;
255 if (len2 > 0) { 255 if (len2 > 0) {
256 if (len2 < fIntervals[0]) { 256 if (len2 < fIntervals[0]) {
257 partialLast = true; 257 partialLast = true;
258 } else { 258 } else {
259 ++numMidPoints; 259 ++numMidPoints;
260 ++results->fNumPoints; 260 ++results->fNumPoints;
261 } 261 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase); 376 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase);
377 for (int i = 0; i < fCount; ++i) { 377 for (int i = 0; i < fCount; ++i) {
378 str->appendf("%.2f", fIntervals[i]); 378 str->appendf("%.2f", fIntervals[i]);
379 if (i < fCount-1) { 379 if (i < fCount-1) {
380 str->appendf(", "); 380 str->appendf(", ");
381 } 381 }
382 } 382 }
383 str->appendf("))"); 383 str->appendf("))");
384 } 384 }
385 #endif 385 #endif
OLDNEW
« no previous file with comments | « src/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698