OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 The Android Open Source Project | 3 * Copyright 2011 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 "SkScan.h" | 10 #include "SkScan.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 */ | 847 */ |
848 void SkScan::AntiFillRect(const SkRect& origR, const SkRegion* clip, | 848 void SkScan::AntiFillRect(const SkRect& origR, const SkRegion* clip, |
849 SkBlitter* blitter) { | 849 SkBlitter* blitter) { |
850 if (clip) { | 850 if (clip) { |
851 SkRect newR; | 851 SkRect newR; |
852 newR.set(clip->getBounds()); | 852 newR.set(clip->getBounds()); |
853 if (!newR.intersect(origR)) { | 853 if (!newR.intersect(origR)) { |
854 return; | 854 return; |
855 } | 855 } |
856 | 856 |
857 SkIRect outerBounds; | 857 const SkIRect outerBounds = newR.roundOut(); |
858 newR.roundOut(&outerBounds); | |
859 | 858 |
860 if (clip->isRect()) { | 859 if (clip->isRect()) { |
861 antifillrect(newR, blitter); | 860 antifillrect(newR, blitter); |
862 } else { | 861 } else { |
863 SkRegion::Cliperator clipper(*clip, outerBounds); | 862 SkRegion::Cliperator clipper(*clip, outerBounds); |
864 while (!clipper.done()) { | 863 while (!clipper.done()) { |
865 newR.set(clipper.rect()); | 864 newR.set(clipper.rect()); |
866 if (newR.intersect(origR)) { | 865 if (newR.intersect(origR)) { |
867 antifillrect(newR, blitter); | 866 antifillrect(newR, blitter); |
868 } | 867 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 | 1044 |
1046 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, | 1045 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, |
1047 const SkRasterClip& clip, SkBlitter* blitter) { | 1046 const SkRasterClip& clip, SkBlitter* blitter) { |
1048 if (clip.isBW()) { | 1047 if (clip.isBW()) { |
1049 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); | 1048 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); |
1050 } else { | 1049 } else { |
1051 SkAAClipBlitterWrapper wrap(clip, blitter); | 1050 SkAAClipBlitterWrapper wrap(clip, blitter); |
1052 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); | 1051 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); |
1053 } | 1052 } |
1054 } | 1053 } |
OLD | NEW |