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 "SkScan.h" | 8 #include "SkScan.h" |
9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
10 #include "SkRasterClip.h" | 10 #include "SkRasterClip.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 case SkPath::kCubic_Verb: { | 464 case SkPath::kCubic_Verb: { |
465 if (SkPaint::kButt_Cap != capStyle) { | 465 if (SkPaint::kButt_Cap != capStyle) { |
466 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 4); | 466 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 4); |
467 } | 467 } |
468 haircubic(pts, clip, blitter, kMaxCubicSubdivideLevel, lineproc)
; | 468 haircubic(pts, clip, blitter, kMaxCubicSubdivideLevel, lineproc)
; |
469 lastPt = pts[3]; | 469 lastPt = pts[3]; |
470 } break; | 470 } break; |
471 case SkPath::kClose_Verb: | 471 case SkPath::kClose_Verb: |
472 pts[0] = lastPt; | 472 pts[0] = lastPt; |
473 pts[1] = firstPt; | 473 pts[1] = firstPt; |
| 474 if (SkPaint::kButt_Cap != capStyle && prevVerb == SkPath::kMove_
Verb) { |
| 475 // cap moveTo/close to match svg expectations for degenerate
segments |
| 476 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 2); |
| 477 } |
474 lineproc(pts, 2, clip, blitter); | 478 lineproc(pts, 2, clip, blitter); |
475 break; | 479 break; |
476 case SkPath::kDone_Verb: | 480 case SkPath::kDone_Verb: |
477 break; | 481 break; |
478 } | 482 } |
479 if (SkPaint::kButt_Cap != capStyle) { | 483 if (SkPaint::kButt_Cap != capStyle) { |
480 prevVerb = verb; | 484 prevVerb = verb; |
481 } | 485 } |
482 } | 486 } |
483 } | 487 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 580 |
577 SkAAClipBlitterWrapper wrap; | 581 SkAAClipBlitterWrapper wrap; |
578 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { | 582 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { |
579 wrap.init(clip, blitter); | 583 wrap.init(clip, blitter); |
580 blitter = wrap.getBlitter(); | 584 blitter = wrap.getBlitter(); |
581 clipRgn = &wrap.getRgn(); | 585 clipRgn = &wrap.getRgn(); |
582 } | 586 } |
583 AntiHairLineRgn(pts, count, clipRgn, blitter); | 587 AntiHairLineRgn(pts, count, clipRgn, blitter); |
584 } | 588 } |
585 } | 589 } |
OLD | NEW |