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 /tests/PathTest.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 'tests/PathTest.cpp')
-rw-r--r-- | tests/PathTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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 <cmath> +#include <utility> 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]); |