Use SkTPin instead of std::clamp std::clamp is c++17 so using it causes some builds to fail. Change-Id: I3e90ffc081e1f18ebab1c4f403826e94e58bf07d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299878 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/src/gpu/tessellate/GrStrokeGeometry.cpp b/src/gpu/tessellate/GrStrokeGeometry.cpp index 9ff4c5c..13674ed 100644 --- a/src/gpu/tessellate/GrStrokeGeometry.cpp +++ b/src/gpu/tessellate/GrStrokeGeometry.cpp
@@ -155,7 +155,7 @@ // Decide how many flat line segments to chop the curve into. int numSegments = wangs_formula_quadratic(p0, p1, p2); - numSegments = std::clamp(numSegments, 1, 1 << kMaxNumLinearSegmentsLog2); + numSegments = SkTPin(numSegments, 1, 1 << kMaxNumLinearSegmentsLog2); // At + B gives a vector tangent to the quadratic. Sk2f A = p0 - p1*2 + p2; @@ -284,7 +284,7 @@ // Decide how many flat line segments to chop the curve into. int numSegments = wangs_formula_cubic(p0, p1, p2, p3); - numSegments = std::clamp(numSegments, 1, 1 << kMaxNumLinearSegmentsLog2); + numSegments = SkTPin(numSegments, 1, 1 << kMaxNumLinearSegmentsLog2); // At^2 + Bt + C gives a vector tangent to the cubic. (More specifically, it's the derivative // minus an irrelevant scale by 3, since all we care about is the direction.)