simplify Gauss-Newton interface

Instead of passing separate functions for t(x), f(x,P), and dfdP(x,P),
instead pass one function that does everything in one go,
returning t(x) - f(x) and dfdP(x) in the same call.

This allows sharing work, makes fewer indirect calls, yadda yadda.
The really important thing is it lets you fit curves where you
can't or don't want to express a target function t(x) directly.

Hopefully this allows fitting inverse curves,
minimizing inv(curve(x))-x instead of inv(x) - curve^-1(x).

Change-Id: I439614cf1fb54a71f8f2f8ff5309245276ec8be1
Reviewed-on: https://skia-review.googlesource.com/124182
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
4 files changed