switch SkTPin impl to pin NaN to lo

It's just much easier to remember and think about
max(lo, min(x, hi)) than max(min(hi, x), lo), and
both pin NaN to one of the two limits.  I'm not sure
if anything in Skia depends on which limit we pin to.

Change-Id: Iceca36a8fffd7072180e82b8b6eb81cbdb5ac97f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327788
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
diff --git a/include/private/SkTPin.h b/include/private/SkTPin.h
index 825a66b..c824c44 100644
--- a/include/private/SkTPin.h
+++ b/include/private/SkTPin.h
@@ -13,12 +13,11 @@
 /** @return x pinned (clamped) between lo and hi, inclusively.
 
     Unlike std::clamp(), SkTPin() always returns a value between lo and hi.
-    If x is NaN, SkTPin() returns hi but std::clamp() returns NaN.
+    If x is NaN, SkTPin() returns lo but std::clamp() returns NaN.
 */
 template <typename T>
 static constexpr const T& SkTPin(const T& x, const T& lo, const T& hi) {
-    // TODO: return std::max(lo, std::min(x, hi)) ?   (clamps NaN to lo)
-    return std::max(std::min(hi, x), lo);
+    return std::max(lo, std::min(x, hi));
 }
 
 #endif