Fix some c++20 warnings

In some of our benchmarks, we use volatile to try to make sure
the compiler doesn't optimize away certain operations. If there is a better way to do that, I'm open to that.

Implicit capturing of this in lambdas has been deprecated due to the
potentially confusing behavior. [1] Changing [=] -> [=, this] won't
work due to the latter being a c++20 extension. However, for many
uses, we can improve the style/readability of the code anyway [2]
by making the captures explicit.

Finally, there was a warning about non-const operator== being ambiguous,
so I fixed those I could find with grep.

[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html
[2] https://google.github.io/styleguide/cppguide.html#Lambda_expressions  "Prefer explicit captures when the lambda will escape the current scope."

Bug: b/311238827
Change-Id: I1725adaa2c258e0fdee2fe398647c15d2cbc9966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/833811
Reviewed-by: John Stiles <johnstiles@google.com>
15 files changed