| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 SkFlattenable* SkDashPathEffect::CreateProc(SkReadBuffer& buffer) { | 363 SkFlattenable* SkDashPathEffect::CreateProc(SkReadBuffer& buffer) { |
| 364 const SkScalar phase = buffer.readScalar(); | 364 const SkScalar phase = buffer.readScalar(); |
| 365 uint32_t count = buffer.getArrayCount(); | 365 uint32_t count = buffer.getArrayCount(); |
| 366 SkAutoSTArray<32, SkScalar> intervals(count); | 366 SkAutoSTArray<32, SkScalar> intervals(count); |
| 367 if (buffer.readScalarArray(intervals.get(), count)) { | 367 if (buffer.readScalarArray(intervals.get(), count)) { |
| 368 return Create(intervals.get(), SkToInt(count), phase); | 368 return Create(intervals.get(), SkToInt(count), phase); |
| 369 } | 369 } |
| 370 return NULL; | 370 return NULL; |
| 371 } | 371 } |
| 372 |
| 373 #ifndef SK_IGNORE_TO_STRING |
| 374 void SkDashPathEffect::toString(SkString* str) const { |
| 375 str->appendf("SkDashPathEffect: ("); |
| 376 str->appendf("count: %d phase %.2f intervals: (", fCount, fPhase); |
| 377 for (int i = 0; i < fCount; ++i) { |
| 378 str->appendf("%.2f", fIntervals[i]); |
| 379 if (i < fCount-1) { |
| 380 str->appendf(", "); |
| 381 } |
| 382 } |
| 383 str->appendf("))"); |
| 384 } |
| 385 #endif |
| OLD | NEW |