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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 | 634 |
635 const SkScalar dx = strokeSize.fX; | 635 const SkScalar dx = strokeSize.fX; |
636 const SkScalar dy = strokeSize.fY; | 636 const SkScalar dy = strokeSize.fY; |
637 SkScalar rx = SkScalarHalf(dx); | 637 SkScalar rx = SkScalarHalf(dx); |
638 SkScalar ry = SkScalarHalf(dy); | 638 SkScalar ry = SkScalarHalf(dy); |
639 SkRect outer, tmp; | 639 SkRect outer, tmp; |
640 | 640 |
641 outer.set(r.fLeft - rx, r.fTop - ry, | 641 outer.set(r.fLeft - rx, r.fTop - ry, |
642 r.fRight + rx, r.fBottom + ry); | 642 r.fRight + rx, r.fBottom + ry); |
643 | 643 |
644 if (r.width() <= dx || r.height() <= dx) { | 644 if (r.width() <= dx || r.height() <= dy) { |
645 SkScan::FillRect(outer, clip, blitter); | 645 SkScan::FillRect(outer, clip, blitter); |
646 return; | 646 return; |
647 } | 647 } |
648 | 648 |
649 tmp.set(outer.fLeft, outer.fTop, outer.fRight, outer.fTop + dy); | 649 tmp.set(outer.fLeft, outer.fTop, outer.fRight, outer.fTop + dy); |
650 SkScan::FillRect(tmp, clip, blitter); | 650 SkScan::FillRect(tmp, clip, blitter); |
651 tmp.fTop = outer.fBottom - dy; | 651 tmp.fTop = outer.fBottom - dy; |
652 tmp.fBottom = outer.fBottom; | 652 tmp.fBottom = outer.fBottom; |
653 SkScan::FillRect(tmp, clip, blitter); | 653 SkScan::FillRect(tmp, clip, blitter); |
654 | 654 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 | 692 |
693 SkAAClipBlitterWrapper wrap; | 693 SkAAClipBlitterWrapper wrap; |
694 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { | 694 if (!clip.quickContains(r.roundOut().makeOutset(1, 1))) { |
695 wrap.init(clip, blitter); | 695 wrap.init(clip, blitter); |
696 blitter = wrap.getBlitter(); | 696 blitter = wrap.getBlitter(); |
697 clipRgn = &wrap.getRgn(); | 697 clipRgn = &wrap.getRgn(); |
698 } | 698 } |
699 AntiHairLineRgn(pts, count, clipRgn, blitter); | 699 AntiHairLineRgn(pts, count, clipRgn, blitter); |
700 } | 700 } |
701 } | 701 } |
OLD | NEW |