OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 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 "SkPathMeasure.h" | 10 #include "SkPathMeasure.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 dst->quadTo(pts[1], pts[2]); | 334 dst->quadTo(pts[1], pts[2]); |
335 } else { | 335 } else { |
336 SkChopQuadAt(pts, tmp0, stopT); | 336 SkChopQuadAt(pts, tmp0, stopT); |
337 dst->quadTo(tmp0[1], tmp0[2]); | 337 dst->quadTo(tmp0[1], tmp0[2]); |
338 } | 338 } |
339 } else { | 339 } else { |
340 SkChopQuadAt(pts, tmp0, startT); | 340 SkChopQuadAt(pts, tmp0, startT); |
341 if (SK_Scalar1 == stopT) { | 341 if (SK_Scalar1 == stopT) { |
342 dst->quadTo(tmp0[3], tmp0[4]); | 342 dst->quadTo(tmp0[3], tmp0[4]); |
343 } else { | 343 } else { |
344 SkChopQuadAt(&tmp0[2], tmp1, SkScalarDiv(stopT - startT, | 344 SkChopQuadAt(&tmp0[2], tmp1, (stopT - startT) / (1 - startT)
); |
345 SK_Scalar1 - startT)); | |
346 dst->quadTo(tmp1[1], tmp1[2]); | 345 dst->quadTo(tmp1[1], tmp1[2]); |
347 } | 346 } |
348 } | 347 } |
349 break; | 348 break; |
350 case kConic_SegType: { | 349 case kConic_SegType: { |
351 SkConic conic(pts[0], pts[2], pts[3], pts[1].fX); | 350 SkConic conic(pts[0], pts[2], pts[3], pts[1].fX); |
352 | 351 |
353 if (0 == startT) { | 352 if (0 == startT) { |
354 if (SK_Scalar1 == stopT) { | 353 if (SK_Scalar1 == stopT) { |
355 dst->conicTo(conic.fPts[1], conic.fPts[2], conic.fW); | 354 dst->conicTo(conic.fPts[1], conic.fPts[2], conic.fW); |
(...skipping 20 matching lines...) Expand all Loading... |
376 dst->cubicTo(pts[1], pts[2], pts[3]); | 375 dst->cubicTo(pts[1], pts[2], pts[3]); |
377 } else { | 376 } else { |
378 SkChopCubicAt(pts, tmp0, stopT); | 377 SkChopCubicAt(pts, tmp0, stopT); |
379 dst->cubicTo(tmp0[1], tmp0[2], tmp0[3]); | 378 dst->cubicTo(tmp0[1], tmp0[2], tmp0[3]); |
380 } | 379 } |
381 } else { | 380 } else { |
382 SkChopCubicAt(pts, tmp0, startT); | 381 SkChopCubicAt(pts, tmp0, startT); |
383 if (SK_Scalar1 == stopT) { | 382 if (SK_Scalar1 == stopT) { |
384 dst->cubicTo(tmp0[4], tmp0[5], tmp0[6]); | 383 dst->cubicTo(tmp0[4], tmp0[5], tmp0[6]); |
385 } else { | 384 } else { |
386 SkChopCubicAt(&tmp0[3], tmp1, SkScalarDiv(stopT - startT, | 385 SkChopCubicAt(&tmp0[3], tmp1, (stopT - startT) / (1 - startT
)); |
387 SK_Scalar1 - startT)); | |
388 dst->cubicTo(tmp1[1], tmp1[2], tmp1[3]); | 386 dst->cubicTo(tmp1[1], tmp1[2], tmp1[3]); |
389 } | 387 } |
390 } | 388 } |
391 break; | 389 break; |
392 default: | 390 default: |
393 SkDEBUGFAIL("unknown segType"); | 391 SkDEBUGFAIL("unknown segType"); |
394 sk_throw(); | 392 sk_throw(); |
395 } | 393 } |
396 } | 394 } |
397 | 395 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 619 |
622 for (int i = 0; i < fSegments.count(); i++) { | 620 for (int i = 0; i < fSegments.count(); i++) { |
623 const Segment* seg = &fSegments[i]; | 621 const Segment* seg = &fSegments[i]; |
624 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", | 622 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", |
625 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), | 623 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), |
626 seg->fType); | 624 seg->fType); |
627 } | 625 } |
628 } | 626 } |
629 | 627 |
630 #endif | 628 #endif |
OLD | NEW |