OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |