[bazel] skiagm::GMFactory type alias: Use std::function instead of function pointers.

This unlocks the possibility of registering GMs dynamically via lambdas with non-empty capture groups (see follow-up CL: https://skia-review.googlesource.com/c/skia/+/734163).

Notes to reviewer:
- The main change is in //gm/gm.h.
- All other changes are to silence compiler warnings/errors.

Bug: b/40045301
Change-Id: If165de4b1ba724e2fbbb95c9787335c8f278f3b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/728256
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
5 files changed