OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 size_t allocSize = sizeof(SkScalar) * fCount; | 558 size_t allocSize = sizeof(SkScalar) * fCount; |
559 if (buffer.validateAvailable(allocSize)) { | 559 if (buffer.validateAvailable(allocSize)) { |
560 fIntervals = (SkScalar*)sk_malloc_throw(allocSize); | 560 fIntervals = (SkScalar*)sk_malloc_throw(allocSize); |
561 buffer.readScalarArray(fIntervals, fCount); | 561 buffer.readScalarArray(fIntervals, fCount); |
562 } else { | 562 } else { |
563 fIntervals = NULL; | 563 fIntervals = NULL; |
564 } | 564 } |
565 | 565 |
566 if (useOldPic) { | 566 if (useOldPic) { |
567 fPhase = 0; | 567 fPhase = 0; |
568 for (int i = 0; i < fInitialDashIndex; ++i) { | 568 if (fInitialDashLength != -1) { // Signal for bad dash interval |
569 fPhase += fIntervals[i]; | 569 for (int i = 0; i < fInitialDashIndex; ++i) { |
| 570 fPhase += fIntervals[i]; |
| 571 } |
| 572 fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength; |
570 } | 573 } |
571 fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength; | |
572 } else { | 574 } else { |
573 this->setInternalMembers(fPhase); | 575 this->setInternalMembers(fPhase); |
574 } | 576 } |
575 } | 577 } |
OLD | NEW |