Add tests for solving cubic roots with double precision.

In order to break the SkPath -> pathops dependency that currently
exist, we'll need to extract the logic to do that. One thing
that will need to be extracted is the ability to solve cubic
functions (e.g. Ax^3 + Bx^2 + Cx + D = 0) which is used to
chop cubics for perspective matrices.

No direct tests for the existing logic in PathOps exists,
so this adds some, including tests for solving quadratics
because the current cubic root finding logic falls back
to the quadratic methods if A == 0.

There does not appear to be existing logic (outside of pathops)
for determining if doubles are close enough, so this adds some
(and a few tests). The double comparison added is only what
was necessary to write tests, not a general purpose comparison
(which is tricky) [1].

[1] https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

Change-Id: I8b072f590027b43c4e7c2e2e2f9e28043b177b55
Bug: skia:13983
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/627018
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
11 files changed