Update VectorScalarMath test avoid failure-prone division.

ES2 is allowed to cheat at integer math and do it as floating point
instead. For example, calculating 9/3 would be interpreted as
9*0.33333, and if rounding goes the wrong way, we may end up with
2.99999 instead of 3. Since division probably rounds down, that would
mean 9/3 gives us 2.

We now avoid any exact divisions against non-power-of-two values.
Small power-of-two divisors are safe, and non-power-of-two divisors
are also safe as long as the result includes a remainder. (e.g.
10/3 is safe, because 3.33333 is an unambiguous result.)

Change-Id: Ia3cbef49a84c65de14772f5a039cf71e221cb4e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/569326
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
4 files changed