diff options
author | Ben Wagner <bungeman@google.com> | 2018-06-18 15:11:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-19 02:06:31 +0000 |
commit | f08d1d0ce19c72bb911f059dcf916cf99a0a2467 (patch) | |
tree | 65fed059b8bd2b730c86e202cc8475fb60b76455 /src/pathops/SkPathOpsTSect.h | |
parent | 93724202640b1f5ae9ccf7646151c9c3bb5afa5c (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/pathops/SkPathOpsTSect.h')
-rw-r--r-- | src/pathops/SkPathOpsTSect.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h index b052df97db..379ae34510 100644 --- a/src/pathops/SkPathOpsTSect.h +++ b/src/pathops/SkPathOpsTSect.h @@ -14,6 +14,8 @@ #include "SkPathOpsRect.h" #include "SkTSort.h" +#include <utility> + #ifdef SK_DEBUG typedef uint8_t SkOpDebugBool; #else @@ -1054,7 +1056,8 @@ void SkTSect<TCurve, OppCurve>::coincidentForce(SkTSect<OppCurve, TCurve>* sect2 double oppStartT = first->fCoinStart.perpT() == -1 ? 0 : SkTMax(0., first->fCoinStart.perpT()); double oppEndT = first->fCoinEnd.perpT() == -1 ? 1 : SkTMin(1., first->fCoinEnd.perpT()); if (!oppMatched) { - SkTSwap(oppStartT, oppEndT); + using std::swap; + swap(oppStartT, oppEndT); } oppFirst->fStartT = oppStartT; oppFirst->fEndT = oppEndT; @@ -1246,8 +1249,9 @@ bool SkTSect<TCurve, OppCurve>::extractCoincident( } #endif if (!oppMatched) { - SkTSwap(oppFirst, oppLast); - SkTSwap(oppStartT, oppEndT); + using std::swap; + swap(oppFirst, oppLast); + swap(oppStartT, oppEndT); } SkOPASSERT(oppStartT < oppEndT); SkASSERT(coinStart == first->fStartT); @@ -1277,7 +1281,8 @@ bool SkTSect<TCurve, OppCurve>::extractCoincident( oppEndT = first->fCoinEnd.perpT(); if (between(0, oppStartT, 1) && between(0, oppEndT, 1)) { if (!oppMatched) { - SkTSwap(oppStartT, oppEndT); + using std::swap; + swap(oppStartT, oppEndT); } oppFirst->fStartT = oppStartT; oppFirst->fEndT = oppEndT; @@ -1526,7 +1531,8 @@ int SkTSect<TCurve, OppCurve>::linesIntersect(SkTSpan<TCurve, OppCurve>* span, double tEnd = oCoinE.perpT(); bool swap = tStart > tEnd; if (swap) { - SkTSwap(tStart, tEnd); + using std::swap; + swap(tStart, tEnd); } tStart = SkTMax(tStart, span->fStartT); tEnd = SkTMin(tEnd, span->fEndT); |