diff options
Diffstat (limited to 'samplecode/SampleColorFilter.cpp')
-rw-r--r-- | samplecode/SampleColorFilter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp index e57ccb0d43..393f9b8c4f 100644 --- a/samplecode/SampleColorFilter.cpp +++ b/samplecode/SampleColorFilter.cpp @@ -23,6 +23,7 @@ static int trunc5(int x) { #define SK_R16_BITS 5 +#ifdef SK_DEBUG static int round5_slow(int x) { int orig = x & 7; int fake = x >> 5; @@ -38,15 +39,17 @@ static int round5_slow(int x) { } return trunc + bias; } +#endif static int round5_fast(int x) { int result = x + 3 - (x >> 5) + (x >> 7); result >>= 3; - +#ifdef SK_DEBUG { int r2 = round5_slow(x); SkASSERT(r2 == result); } +#endif return result; } |