Index: src/core/SkScan_AAAPath.cpp |
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp |
index 3325249833bb9282cf285b67e74750a0dbebead6..91b6e397ae260a2e158c8314a5406fd1bde30c35 100644 |
--- a/src/core/SkScan_AAAPath.cpp |
+++ b/src/core/SkScan_AAAPath.cpp |
@@ -83,9 +83,9 @@ number of scan lines in our algorithm is only about 3 + H while the |
/////////////////////////////////////////////////////////////////////////////// |
-inline void addAlpha(SkAlpha& alpha, SkAlpha delta) { |
- SkASSERT(alpha + (int)delta <= 0xFF); |
- alpha += delta; |
+static inline void addAlpha(SkAlpha& alpha, SkAlpha delta) { |
+ SkASSERT(alpha + (int)delta <= 256); |
+ alpha = SkAlphaRuns::CatchOverflow(alpha + (int)delta); |
} |
class AdditiveBlitter : public SkBlitter { |
@@ -481,7 +481,7 @@ static inline SkAlpha partialTriangleToAlpha(SkFixed a, SkFixed b) { |
} |
static inline SkAlpha getPartialAlpha(SkAlpha alpha, SkFixed partialHeight) { |
- return (alpha * partialHeight) >> 16; |
+ return (alpha * partialHeight + SK_FixedHalf) >> 16; |
} |
static inline SkAlpha getPartialAlpha(SkAlpha alpha, SkAlpha fullAlpha) { |