aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-06-18 15:11:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 02:06:31 +0000
commitf08d1d0ce19c72bb911f059dcf916cf99a0a2467 (patch)
tree65fed059b8bd2b730c86e202cc8475fb60b76455 /include/core/SkRect.h
parent93724202640b1f5ae9ccf7646151c9c3bb5afa5c (diff)
Stop using SkTSwap.
Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index b33b0b9ac9..ed0e599ad9 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -23,6 +23,8 @@
#include "../private/SkSafe32.h"
#include "../private/SkTFitsIn.h"
+#include <utility>
+
struct SkRect;
/** \struct SkIRect
@@ -646,11 +648,12 @@ struct SK_API SkIRect {
and width() and height() will be zero or positive.
*/
void sort() {
+ using std::swap;
if (fLeft > fRight) {
- SkTSwap<int32_t>(fLeft, fRight);
+ swap(fLeft, fRight);
}
if (fTop > fBottom) {
- SkTSwap<int32_t>(fTop, fBottom);
+ swap(fTop, fBottom);
}
}
@@ -1519,12 +1522,13 @@ public:
and width() and height() will be zero or positive.
*/
void sort() {
+ using std::swap;
if (fLeft > fRight) {
- SkTSwap<SkScalar>(fLeft, fRight);
+ swap(fLeft, fRight);
}
if (fTop > fBottom) {
- SkTSwap<SkScalar>(fTop, fBottom);
+ swap(fTop, fBottom);
}
}