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 "SkMathPriv.h" | 10 #include "SkMathPriv.h" |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 if (SkPaint::kButt_Cap != capStyle && prevVerb == SkPath::kMove_
Verb) { | 586 if (SkPaint::kButt_Cap != capStyle && prevVerb == SkPath::kMove_
Verb) { |
587 // cap moveTo/close to match svg expectations for degenerate
segments | 587 // cap moveTo/close to match svg expectations for degenerate
segments |
588 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 2); | 588 extend_pts<capStyle>(prevVerb, iter.peek(), pts, 2); |
589 } | 589 } |
590 lineproc(pts, 2, clip, blitter); | 590 lineproc(pts, 2, clip, blitter); |
591 break; | 591 break; |
592 case SkPath::kDone_Verb: | 592 case SkPath::kDone_Verb: |
593 break; | 593 break; |
594 } | 594 } |
595 if (SkPaint::kButt_Cap != capStyle) { | 595 if (SkPaint::kButt_Cap != capStyle) { |
| 596 if (prevVerb == SkPath::kMove_Verb && |
| 597 verb >= SkPath::kLine_Verb && verb <= SkPath::kCubic_Verb) { |
| 598 firstPt = pts[0]; // the curve moved the initial point, so clos
e to it instead |
| 599 } |
596 prevVerb = verb; | 600 prevVerb = verb; |
597 } | 601 } |
598 } | 602 } |
599 } | 603 } |
600 | 604 |
601 void SkScan::HairPath(const SkPath& path, const SkRasterClip& clip, SkBlitter* b
litter) { | 605 void SkScan::HairPath(const SkPath& path, const SkRasterClip& clip, SkBlitter* b
litter) { |
602 hair_path<SkPaint::kButt_Cap>(path, clip, blitter, SkScan::HairLineRgn); | 606 hair_path<SkPaint::kButt_Cap>(path, clip, blitter, SkScan::HairLineRgn); |
603 } | 607 } |
604 | 608 |
605 void SkScan::AntiHairPath(const SkPath& path, const SkRasterClip& clip, SkBlitte
r* blitter) { | 609 void SkScan::AntiHairPath(const SkPath& path, const SkRasterClip& clip, SkBlitte
r* blitter) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 | 696 |
693 SkAAClipBlitterWrapper wrap; | 697 SkAAClipBlitterWrapper wrap; |
694 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { | 698 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { |
695 wrap.init(clip, blitter); | 699 wrap.init(clip, blitter); |
696 blitter = wrap.getBlitter(); | 700 blitter = wrap.getBlitter(); |
697 clipRgn = &wrap.getRgn(); | 701 clipRgn = &wrap.getRgn(); |
698 } | 702 } |
699 AntiHairLineRgn(pts, count, clipRgn, blitter); | 703 AntiHairLineRgn(pts, count, clipRgn, blitter); |
700 } | 704 } |
701 } | 705 } |
OLD | NEW |