aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPath.cpp
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/core/SkPath.cpp
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/core/SkPath.cpp')
-rw-r--r--src/core/SkPath.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index e38d736294..99ac492967 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -22,6 +22,7 @@
#include "SkTo.h"
#include <cmath>
+#include <utility>
static float poly_eval(float A, float B, float C, float t) {
return (A * t + B) * t + C;
@@ -201,10 +202,11 @@ bool operator==(const SkPath& a, const SkPath& b) {
void SkPath::swap(SkPath& that) {
if (this != &that) {
+ using std::swap;
fPathRef.swap(that.fPathRef);
- SkTSwap(fLastMoveToIndex, that.fLastMoveToIndex);
- SkTSwap(fFillType, that.fFillType);
- SkTSwap(fIsVolatile, that.fIsVolatile);
+ swap(fLastMoveToIndex, that.fLastMoveToIndex);
+ swap(fFillType, that.fFillType);
+ swap(fIsVolatile, that.fIsVolatile);
// Non-atomic swaps of atomic values.
Convexity c = fConvexity.load();
@@ -2797,7 +2799,8 @@ static int winding_mono_cubic(const SkPoint pts[], SkScalar x, SkScalar y, int*
int dir = 1;
if (y0 > y3) {
- SkTSwap(y0, y3);
+ using std::swap;
+ swap(y0, y3);
dir = -1;
}
if (y < y0 || y > y3) {
@@ -2871,7 +2874,8 @@ static int winding_mono_conic(const SkConic& conic, SkScalar x, SkScalar y, int*
int dir = 1;
if (y0 > y2) {
- SkTSwap(y0, y2);
+ using std::swap;
+ swap(y0, y2);
dir = -1;
}
if (y < y0 || y > y2) {
@@ -2945,7 +2949,8 @@ static int winding_mono_quad(const SkPoint pts[], SkScalar x, SkScalar y, int* o
int dir = 1;
if (y0 > y2) {
- SkTSwap(y0, y2);
+ using std::swap;
+ swap(y0, y2);
dir = -1;
}
if (y < y0 || y > y2) {
@@ -3018,7 +3023,8 @@ static int winding_line(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurv
int dir = 1;
if (y0 > y1) {
- SkTSwap(y0, y1);
+ using std::swap;
+ swap(y0, y1);
dir = -1;
}
if (y < y0 || y > y1) {