| 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 clipBounds.set(clip->getBounds()); | 618 clipBounds.set(clip->getBounds()); |
| 619 /* We perform integral clipping later on, but we do a scalar clip first | 619 /* We perform integral clipping later on, but we do a scalar clip first |
| 620 to ensure that our coordinates are expressible in fixed/integers. | 620 to ensure that our coordinates are expressible in fixed/integers. |
| 621 | 621 |
| 622 antialiased hairlines can draw up to 1/2 of a pixel outside of | 622 antialiased hairlines can draw up to 1/2 of a pixel outside of |
| 623 their bounds, so we need to outset the clip before calling the | 623 their bounds, so we need to outset the clip before calling the |
| 624 clipper. To make the numerics safer, we outset by a whole pixel, | 624 clipper. To make the numerics safer, we outset by a whole pixel, |
| 625 since the 1/2 pixel boundary is important to the antihair blitter, | 625 since the 1/2 pixel boundary is important to the antihair blitter, |
| 626 we don't want to risk numerical fate by chopping on that edge. | 626 we don't want to risk numerical fate by chopping on that edge. |
| 627 */ | 627 */ |
| 628 clipBounds.inset(-SK_Scalar1, -SK_Scalar1); | 628 clipBounds.outset(SK_Scalar1, SK_Scalar1); |
| 629 | 629 |
| 630 if (!SkLineClipper::IntersectLine(pts, clipBounds, pts)) { | 630 if (!SkLineClipper::IntersectLine(pts, clipBounds, pts)) { |
| 631 return; | 631 return; |
| 632 } | 632 } |
| 633 } | 633 } |
| 634 | 634 |
| 635 SkFDot6 x0 = SkScalarToFDot6(pts[0].fX); | 635 SkFDot6 x0 = SkScalarToFDot6(pts[0].fX); |
| 636 SkFDot6 y0 = SkScalarToFDot6(pts[0].fY); | 636 SkFDot6 y0 = SkScalarToFDot6(pts[0].fY); |
| 637 SkFDot6 x1 = SkScalarToFDot6(pts[1].fX); | 637 SkFDot6 x1 = SkScalarToFDot6(pts[1].fX); |
| 638 SkFDot6 y1 = SkScalarToFDot6(pts[1].fY); | 638 SkFDot6 y1 = SkScalarToFDot6(pts[1].fY); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 | 1065 |
| 1066 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, | 1066 void SkScan::AntiFrameRect(const SkRect& r, const SkPoint& strokeSize, |
| 1067 const SkRasterClip& clip, SkBlitter* blitter) { | 1067 const SkRasterClip& clip, SkBlitter* blitter) { |
| 1068 if (clip.isBW()) { | 1068 if (clip.isBW()) { |
| 1069 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); | 1069 AntiFrameRect(r, strokeSize, &clip.bwRgn(), blitter); |
| 1070 } else { | 1070 } else { |
| 1071 SkAAClipBlitterWrapper wrap(clip, blitter); | 1071 SkAAClipBlitterWrapper wrap(clip, blitter); |
| 1072 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); | 1072 AntiFrameRect(r, strokeSize, &wrap.getRgn(), wrap.getBlitter()); |
| 1073 } | 1073 } |
| 1074 } | 1074 } |
| OLD | NEW |