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 --- tests/PathTest.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/PathTest.cpp') diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 30d27c1e1b..a742bcbbee 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -26,6 +26,7 @@ #include "Test.h" #include +#include static void set_radii(SkVector radii[4], int index, float rad) { sk_bzero(radii, sizeof(SkVector) * 4); @@ -1804,10 +1805,12 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) { for (size_t q = 0; q < SK_ARRAY_COUNT(kQueries); ++q) { SkRect qRect = kQueries[q].fQueryRect; if (inv & 0x1) { - SkTSwap(qRect.fLeft, qRect.fRight); + using std::swap; + swap(qRect.fLeft, qRect.fRight); } if (inv & 0x2) { - SkTSwap(qRect.fTop, qRect.fBottom); + using std::swap; + swap(qRect.fTop, qRect.fBottom); } for (int d = 0; d < 2; ++d) { SkPath::Direction dir = d ? SkPath::kCCW_Direction : SkPath::kCW_Direction; @@ -2145,6 +2148,7 @@ static void check_simple_closed_rect(skiatest::Reporter* reporter, const SkPath& } static void test_is_simple_closed_rect(skiatest::Reporter* reporter) { + using std::swap; SkRect r = SkRect::MakeEmpty(); SkPath::Direction d = SkPath::kCCW_Direction; unsigned s = ~0U; @@ -2216,12 +2220,12 @@ static void test_is_simple_closed_rect(skiatest::Reporter* reporter) { static constexpr unsigned kXSwapStarts[] = { 1, 0, 3, 2 }; static constexpr unsigned kYSwapStarts[] = { 3, 2, 1, 0 }; SkRect swapRect = testRect; - SkTSwap(swapRect.fLeft, swapRect.fRight); + swap(swapRect.fLeft, swapRect.fRight); path2.reset(); path2.addRect(swapRect, dir, start); check_simple_closed_rect(reporter, path2, testRect, swapDir, kXSwapStarts[start]); swapRect = testRect; - SkTSwap(swapRect.fTop, swapRect.fBottom); + swap(swapRect.fTop, swapRect.fBottom); path2.reset(); path2.addRect(swapRect, dir, start); check_simple_closed_rect(reporter, path2, testRect, swapDir, kYSwapStarts[start]); -- cgit v1.2.3