From f08d1d0ce19c72bb911f059dcf916cf99a0a2467 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 18 Jun 2018 15:11:00 -0400 Subject: 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 include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary Reviewed-by: Mike Klein Commit-Queue: Ben Wagner --- src/core/SkScan_AAAPath.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core/SkScan_AAAPath.cpp') 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 + /////////////////////////////////////////////////////////////////////////////// /* @@ -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); -- cgit v1.2.3