Optimize QuadF's PointIsInTriangle function

The original version required 34 float ops (16mul + 11sub + 5add + 2div).
This version removes some of the intermediate dot products, reducing the
max number of operations to 19 (6mul + 2div + 11sub).  It also avoids using
doubles, warranted by the removal of several intermediate operations that might
otherwise incur significance loss.

In local (release build) benchmarks, this reduced the typical CPU cost of a call to
QuadF::Contains(...) by 2/3, both with GCC and Clang on an ARM v7 device.

Review URL: https://codereview.chromium.org/291493003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271088 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: b63a661dacd6c54545d5db5a6e6eefc0e599755f
2 files changed
tree: 740577898dda177d67645d9735d6bfa28f298c06
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/