diff options
author | Yuqian Li <liyuqian@google.com> | 2018-01-09 16:27:15 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-10 14:18:39 +0000 |
commit | 52f8e71a45ead72f257317f82775eb3459b71eae (patch) | |
tree | aab78d367c0acd9f155e37a2e0da6469f2b28fe3 /src/core | |
parent | cf8626d6917e489d18fbbe38d5887aaa195f5d53 (diff) |
Snap alpha for small rects
This is more similar to our alpha snapping in AAA. More critically, we
may have a tiny alpha difference after some 90 degree rotations and that
breaks the Chromium svg layout tests (where the expected reference is a
rotated svg...)
TBR: fmalita@google.com
Bug: skia:
Change-Id: I59b750153488083f65b731643e0baca823cb78e4
Reviewed-on: https://skia-review.googlesource.com/92940
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBlitter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 4bbd80d93f..1f21e28dad 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -42,7 +42,8 @@ void SkBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], */ inline static SkAlpha ScalarToAlpha(SkScalar a) { - return (SkAlpha)(a * 255); + SkAlpha alpha = (SkAlpha)(a * 255); + return alpha > 247 ? 0xFF : alpha < 8 ? 0 : alpha; } void SkBlitter::blitFatAntiRect(const SkRect& rect) { |