aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
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 /src/utils
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 'src/utils')
-rw-r--r--src/utils/SkDashPath.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/utils/SkDashPath.cpp b/src/utils/SkDashPath.cpp
index e4840c84b6..fc73c9f5a7 100644
--- a/src/utils/SkDashPath.cpp
+++ b/src/utils/SkDashPath.cpp
@@ -10,6 +10,8 @@
#include "SkPointPriv.h"
#include "SkStrokeRec.h"
+#include <utility>
+
static inline int is_even(int x) {
return !(x & 1);
}
@@ -108,7 +110,8 @@ static bool clip_line(SkPoint pts[2], const SkRect& bounds, SkScalar intervalLen
SkScalar maxXY = (&pts[1].fX)[xyOffset];
bool swapped = maxXY < minXY;
if (swapped) {
- SkTSwap(minXY, maxXY);
+ using std::swap;
+ swap(minXY, maxXY);
}
SkASSERT(minXY <= maxXY);
@@ -137,7 +140,8 @@ static bool clip_line(SkPoint pts[2], const SkRect& bounds, SkScalar intervalLen
SkASSERT(maxXY >= minXY);
if (swapped) {
- SkTSwap(minXY, maxXY);
+ using std::swap;
+ swap(minXY, maxXY);
}
(&pts[0].fX)[xyOffset] = minXY;
(&pts[1].fX)[xyOffset] = maxXY;
@@ -196,7 +200,8 @@ static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
SkScalar maxX = pts[1].fX;
if (dx < 0) {
- SkTSwap(minX, maxX);
+ using std::swap;
+ swap(minX, maxX);
}
SkASSERT(minX <= maxX);
@@ -219,7 +224,8 @@ static bool cull_path(const SkPath& srcPath, const SkStrokeRec& rec,
SkASSERT(maxX >= minX);
if (dx < 0) {
- SkTSwap(minX, maxX);
+ using std::swap;
+ swap(minX, maxX);
}
pts[0].fX = minX;
pts[1].fX = maxX;