Remove SkTMin and SkTMax
Use std::min and std::max everywhere.
SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.
Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/utils/SkMultiPictureDocument.cpp b/src/utils/SkMultiPictureDocument.cpp
index 25be716..8a47be1 100644
--- a/src/utils/SkMultiPictureDocument.cpp
+++ b/src/utils/SkMultiPictureDocument.cpp
@@ -42,7 +42,7 @@
static SkSize join(const SkTArray<SkSize>& sizes) {
SkSize joined = {0, 0};
for (SkSize s : sizes) {
- joined = SkSize{SkTMax(joined.width(), s.width()), SkTMax(joined.height(), s.height())};
+ joined = SkSize{std::max(joined.width(), s.width()), std::max(joined.height(), s.height())};
}
return joined;
}
@@ -185,8 +185,8 @@
}
SkSize joined = {0.0f, 0.0f};
for (int i = 0; i < dstArrayCount; ++i) {
- joined = SkSize{SkTMax(joined.width(), dstArray[i].fSize.width()),
- SkTMax(joined.height(), dstArray[i].fSize.height())};
+ joined = SkSize{std::max(joined.width(), dstArray[i].fSize.width()),
+ std::max(joined.height(), dstArray[i].fSize.height())};
}
auto picture = SkPicture::MakeFromStream(stream, procs);