Fix the quickSkFDot6Div range check

Our previous (1 << 10) limit is based on 2^32 being our maximum value.
However, that's not the case because we have one more sign bit.
Therefore I should make it (1 << 9).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4973

Change-Id: I38acb627cdb2514d3e4996aef02480b389cf3588
Reviewed-on: https://skia-review.googlesource.com/4973
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
This commit is contained in:
Yuqian Li 2016-11-17 14:31:53 -05:00 committed by Skia Commit-Bot
parent 514baff8be
commit c88fc74447

View File

@ -23,8 +23,8 @@ public:
static inline SkFixed quickSkFDot6Div(SkFDot6 a, SkFDot6 b) {
// Max inverse of b is 2^6 which is 2^22 in SkFixed format.
// Hence the safe value of abs(a) should be less than 2^10.
if (SkAbs32(b) < kInverseTableSize && SkAbs32(a) < (1 << 10)) {
// Hence the safe value of abs(a) should be less than 2^9.
if (SkAbs32(b) < kInverseTableSize && SkAbs32(a) < (1 << 9)) {
SkASSERT((int64_t)a * QuickFDot6Inverse::Lookup(b) <= SK_MaxS32
&& (int64_t)a * QuickFDot6Inverse::Lookup(b) >= SK_MinS32);
SkFixed ourAnswer = (a * QuickFDot6Inverse::Lookup(b)) >> 6;