aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkBlitter.cpp2
-rw-r--r--src/core/SkScan_AntiPath.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 8bb4b4f20a..ec1606687c 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -487,7 +487,7 @@ void SkRgnClipBlitter::blitAntiRect(int x, int y, int width, int height,
const SkIRect& r = iter.rect();
SkASSERT(bounds.contains(r));
SkASSERT(r.fLeft >= x);
- SkASSERT(r.fRight < x + width + 2);
+ SkASSERT(r.fRight <= x + width + 2);
SkAlpha effectiveLeftAlpha = (r.fLeft == x) ? leftAlpha : 255;
SkAlpha effectiveRightAlpha = (r.fRight == x + width + 2) ?
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index fc7f737e13..97843ef7c3 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -157,9 +157,9 @@ static inline int coverage_to_alpha(int aa) {
}
static inline int coverage_to_exact_alpha(int aa) {
- static int map [] = { 0, 64, 128, 192, 255 };
- SkASSERT(SHIFT == 2);
- return map[aa];
+ int alpha = (256 >> SHIFT) * aa;
+ // clamp 256->255
+ return alpha - (alpha >> 8);
}
void SuperBlitter::blitH(int x, int y, int width) {