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_AAAPath.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_AAAPath.cpp')
-rw-r--r-- | src/core/SkScan_AAAPath.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp index bd649e7aef..9dbb271890 100644 --- a/src/core/SkScan_AAAPath.cpp +++ b/src/core/SkScan_AAAPath.cpp @@ -23,6 +23,8 @@ #include "SkTo.h" #include "SkUtils.h" +#include <utility> + /////////////////////////////////////////////////////////////////////////////// /* @@ -581,8 +583,8 @@ static inline SkAlpha f2a(SkFixed f) { // Suppose that line (l1, y)-(r1, y+1) intersects with (l2, y)-(r2, y+1), // approximate (very coarsely) the x coordinate of the intersection. static inline SkFixed approximateIntersection(SkFixed l1, SkFixed r1, SkFixed l2, SkFixed r2) { - if (l1 > r1) { SkTSwap(l1, r1); } - if (l2 > r2) { SkTSwap(l2, r2); } + if (l1 > r1) { using std::swap; swap(l1, r1); } + if (l2 > r2) { using std::swap; swap(l2, r2); } return (SkTMax(l1, l2) + SkTMin(r1, r2)) >> 1; } @@ -830,8 +832,8 @@ static SK_ALWAYS_INLINE void blit_trapezoid_row(AdditiveBlitter* blitter, int y, // to exclude the area that's not covered by the path. // Swapping (ul, ll) or (ur, lr) won't affect that exclusion // so we'll do that for simplicity. - if (ul > ll) { SkTSwap(ul, ll); } - if (ur > lr) { SkTSwap(ur, lr); } + if (ul > ll) { using std::swap; swap(ul, ll); } + if (ur > lr) { using std::swap; swap(ur, lr); } SkFixed joinLeft = SkFixedCeilToFixed(ll); SkFixed joinRite = SkFixedFloorToFixed(ur); @@ -978,7 +980,8 @@ static inline bool isSmoothEnough(SkAnalyticEdge* leftE, SkAnalyticEdge* riteE, } // Ensure that currE is the next left edge and nextCurrE is the next right edge. Swap if not. if (nextCurrE->fUpperX < currE->fUpperX) { - SkTSwap(currE, nextCurrE); + using std::swap; + swap(currE, nextCurrE); } return isSmoothEnough(leftE, currE, stop_y) && isSmoothEnough(riteE, nextCurrE, stop_y); } @@ -1037,7 +1040,8 @@ static inline void aaa_walk_convex_edges(SkAnalyticEdge* prevHead, if (leftE->fX > riteE->fX || (leftE->fX == riteE->fX && leftE->fDX > riteE->fDX)) { - SkTSwap(leftE, riteE); + using std::swap; + swap(leftE, riteE); } SkFixed local_bot_fixed = SkMin32(leftE->fLowerY, riteE->fLowerY); |