Chromium Code Reviews| Index: src/core/SkEdge.cpp |
| diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp |
| index c64896f2e0345125ba35d8b5728fb92c612773f9..94b7870b034b66814b89ebc718c74e4861641653 100644 |
| --- a/src/core/SkEdge.cpp |
| +++ b/src/core/SkEdge.cpp |
| @@ -326,8 +326,9 @@ static inline int SkFDot6UpShift(SkFDot6 x, int upShift) { |
| */ |
| static SkFDot6 cubic_delta_from_line(SkFDot6 a, SkFDot6 b, SkFDot6 c, SkFDot6 d) |
| { |
| - SkFDot6 oneThird = ((a << 3) - ((b << 4) - b) + 6*c + d) * 19 >> 9; |
| - SkFDot6 twoThird = (a + 6*b - ((c << 4) - c) + (d << 3)) * 19 >> 9; |
| + // since our parameters may be negative, we don't use << to avoid ASAN warnings |
| + SkFDot6 oneThird = (a*8 - b*15 + 6*c + d) * 19 >> 9; |
| + SkFDot6 twoThird = (a + 6*b - c*15 + d*8) * 19 >> 9; |
|
caryclark
2016/03/08 14:20:23
I'm curious how this works. If the bug is that the
reed1
2016/03/08 14:26:44
I don't think that is the bug. I think the bug fro
|
| return SkMax32(SkAbs32(oneThird), SkAbs32(twoThird)); |
| } |