| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "Fuzz.h" | 8 #include "Fuzz.h" |
| 9 | 9 |
| 10 // This really is just an example Fuzz*.cpp file. | 10 // This really is just an example Fuzz*.cpp file. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 int min = SkTMin(a,b), | 26 int min = SkTMin(a,b), |
| 27 max = SkTMax(a,b); | 27 max = SkTMax(a,b); |
| 28 int delta = (max-min)/3; | 28 int delta = (max-min)/3; |
| 29 | 29 |
| 30 if (c <= min+delta) return max; | 30 if (c <= min+delta) return max; |
| 31 if (c >= max-delta) return min; | 31 if (c >= max-delta) return min; |
| 32 return c; | 32 return c; |
| 33 } | 33 } |
| 34 | 34 |
| 35 DEF_FUZZ(Paeth, fuzz) { | 35 DEF_FUZZ(Paeth, fuzz) { |
| 36 int a = fuzz->nextU(), | 36 auto a = fuzz->nextB(), |
| 37 b = fuzz->nextU(), | 37 b = fuzz->nextB(), |
| 38 c = fuzz->nextU(); | 38 c = fuzz->nextB(); |
| 39 ASSERT(paeth_alt(a,b,c) == paeth_std(a,b,c)); | 39 ASSERT(paeth_alt(a,b,c) == paeth_std(a,b,c)); |
| 40 } | 40 } |
| OLD | NEW |