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/core/SkScan_Hairline.cpp | |
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/core/SkScan_Hairline.cpp')
-rw-r--r-- | src/core/SkScan_Hairline.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp index 815130d532..d9c0408b34 100644 --- a/src/core/SkScan_Hairline.cpp +++ b/src/core/SkScan_Hairline.cpp @@ -13,6 +13,8 @@ #include "SkFDot6.h" #include "SkLineClipper.h" +#include <utility> + static void horiline(int x, int stopx, SkFixed fy, SkFixed dy, SkBlitter* blitter) { SkASSERT(x < stopx); @@ -110,8 +112,9 @@ void SkScan::HairLineRgn(const SkPoint array[], int arrayCount, const SkRegion* if (SkAbs32(dx) > SkAbs32(dy)) { // mostly horizontal if (x0 > x1) { // we want to go left-to-right - SkTSwap<SkFDot6>(x0, x1); - SkTSwap<SkFDot6>(y0, y1); + using std::swap; + swap(x0, x1); + swap(y0, y1); } int ix0 = SkFDot6Round(x0); int ix1 = SkFDot6Round(x1); @@ -125,8 +128,9 @@ void SkScan::HairLineRgn(const SkPoint array[], int arrayCount, const SkRegion* horiline(ix0, ix1, startY, slope, blitter); } else { // mostly vertical if (y0 > y1) { // we want to go top-to-bottom - SkTSwap<SkFDot6>(x0, x1); - SkTSwap<SkFDot6>(y0, y1); + using std::swap; + swap(x0, x1); + swap(y0, y1); } int iy0 = SkFDot6Round(y0); int iy1 = SkFDot6Round(y1); |