| 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" |
| 11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
| 12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
| 13 #include "SkStrokeRec.h" |
| 13 | 14 |
| 14 SkDashPathEffect::SkDashPathEffect(const SkScalar intervals[], int count, SkScal
ar phase) | 15 SkDashPathEffect::SkDashPathEffect(const SkScalar intervals[], int count, SkScal
ar phase) |
| 15 : fPhase(0) | 16 : fPhase(0) |
| 16 , fInitialDashLength(0) | 17 , fInitialDashLength(0) |
| 17 , fInitialDashIndex(0) | 18 , fInitialDashIndex(0) |
| 18 , fIntervalLength(0) { | 19 , fIntervalLength(0) { |
| 19 SkASSERT(intervals); | 20 SkASSERT(intervals); |
| 20 SkASSERT(count > 1 && SkAlign2(count) == count); | 21 SkASSERT(count > 1 && SkAlign2(count) == count); |
| 21 | 22 |
| 22 fIntervals = (SkScalar*)sk_malloc_throw(sizeof(SkScalar) * count); | 23 fIntervals = (SkScalar*)sk_malloc_throw(sizeof(SkScalar) * count); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase); | 377 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase); |
| 377 for (int i = 0; i < fCount; ++i) { | 378 for (int i = 0; i < fCount; ++i) { |
| 378 str->appendf("%.2f", fIntervals[i]); | 379 str->appendf("%.2f", fIntervals[i]); |
| 379 if (i < fCount-1) { | 380 if (i < fCount-1) { |
| 380 str->appendf(", "); | 381 str->appendf(", "); |
| 381 } | 382 } |
| 382 } | 383 } |
| 383 str->appendf("))"); | 384 str->appendf("))"); |
| 384 } | 385 } |
| 385 #endif | 386 #endif |
| OLD | NEW |