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 !defined(SK_SUPPORT_LEGACY_HAIRLINE_END_CAP) |
596 if (prevVerb == SkPath::kMove_Verb && | 597 if (prevVerb == SkPath::kMove_Verb && |
597 verb >= SkPath::kLine_Verb && verb <= SkPath::kCubic_Verb) { | 598 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 firstPt = pts[0]; // the curve moved the initial point, so clos
e to it instead |
599 } | 600 } |
| 601 #endif |
600 prevVerb = verb; | 602 prevVerb = verb; |
601 } | 603 } |
602 } | 604 } |
603 } | 605 } |
604 | 606 |
605 void SkScan::HairPath(const SkPath& path, const SkRasterClip& clip, SkBlitter* b
litter) { | 607 void SkScan::HairPath(const SkPath& path, const SkRasterClip& clip, SkBlitter* b
litter) { |
606 hair_path<SkPaint::kButt_Cap>(path, clip, blitter, SkScan::HairLineRgn); | 608 hair_path<SkPaint::kButt_Cap>(path, clip, blitter, SkScan::HairLineRgn); |
607 } | 609 } |
608 | 610 |
609 void SkScan::AntiHairPath(const SkPath& path, const SkRasterClip& clip, SkBlitte
r* blitter) { | 611 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... |
696 | 698 |
697 SkAAClipBlitterWrapper wrap; | 699 SkAAClipBlitterWrapper wrap; |
698 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { | 700 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { |
699 wrap.init(clip, blitter); | 701 wrap.init(clip, blitter); |
700 blitter = wrap.getBlitter(); | 702 blitter = wrap.getBlitter(); |
701 clipRgn = &wrap.getRgn(); | 703 clipRgn = &wrap.getRgn(); |
702 } | 704 } |
703 AntiHairLineRgn(pts, count, clipRgn, blitter); | 705 AntiHairLineRgn(pts, count, clipRgn, blitter); |
704 } | 706 } |
705 } | 707 } |
OLD | NEW |