aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/GrShapeTest.cpp5
-rw-r--r--tests/PathOpsConicLineIntersectionTest.cpp8
-rw-r--r--tests/PathOpsCubicLineIntersectionTest.cpp8
-rw-r--r--tests/PathOpsQuadLineIntersectionTest.cpp8
-rw-r--r--tests/PathOpsQuadLineIntersectionThreadedTest.cpp8
-rw-r--r--tests/PathOpsTestCommon.cpp5
-rw-r--r--tests/PathTest.cpp12
-rw-r--r--tests/TArrayTest.cpp4
8 files changed, 42 insertions, 16 deletions
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp
index 930012c33f..905ff4490e 100644
--- a/tests/GrShapeTest.cpp
+++ b/tests/GrShapeTest.cpp
@@ -17,6 +17,8 @@
#include "SkSurface.h"
#include "SkClipOpPriv.h"
+#include <utility>
+
uint32_t GrShape::testingOnly_getOriginalGenerationID() const {
if (const auto* lp = this->originalPathForListeners()) {
return lp->getGenerationID();
@@ -1932,7 +1934,8 @@ DEF_TEST(GrShape_lines, r) {
canonicalizeAsAB = true;
} else if (pts[1] == kA && pts[0] == kB) {
canonicalizeAsAB = false;
- SkTSwap(canonicalPts[0], canonicalPts[1]);
+ using std::swap;
+ swap(canonicalPts[0], canonicalPts[1]);
} else {
ERRORF(r, "Should return pts (a,b) or (b, a)");
return;
diff --git a/tests/PathOpsConicLineIntersectionTest.cpp b/tests/PathOpsConicLineIntersectionTest.cpp
index c3d4a2afe3..8a96519815 100644
--- a/tests/PathOpsConicLineIntersectionTest.cpp
+++ b/tests/PathOpsConicLineIntersectionTest.cpp
@@ -13,6 +13,8 @@
#include "SkReduceOrder.h"
#include "Test.h"
+#include <utility>
+
static struct lineConic {
ConicPts conic;
SkDLine line;
@@ -38,7 +40,8 @@ static int doIntersect(SkIntersections& intersections, const SkDConic& conic, co
double bottom = line[1].fY;
flipped = top > bottom;
if (flipped) {
- SkTSwap<double>(top, bottom);
+ using std::swap;
+ swap(top, bottom);
}
result = intersections.vertical(conic, top, bottom, line[0].fX, flipped);
} else if (line[0].fY == line[1].fY) {
@@ -46,7 +49,8 @@ static int doIntersect(SkIntersections& intersections, const SkDConic& conic, co
double right = line[1].fX;
flipped = left > right;
if (flipped) {
- SkTSwap<double>(left, right);
+ using std::swap;
+ swap(left, right);
}
result = intersections.horizontal(conic, left, right, line[0].fY, flipped);
} else {
diff --git a/tests/PathOpsCubicLineIntersectionTest.cpp b/tests/PathOpsCubicLineIntersectionTest.cpp
index a6ae5e6441..87e6cea51d 100644
--- a/tests/PathOpsCubicLineIntersectionTest.cpp
+++ b/tests/PathOpsCubicLineIntersectionTest.cpp
@@ -11,6 +11,8 @@
#include "SkReduceOrder.h"
#include "Test.h"
+#include <utility>
+
struct lineCubic {
CubicPts cubic;
SkDLine line;
@@ -106,7 +108,8 @@ static int doIntersect(SkIntersections& intersections, const SkDCubic& cubic, co
double bottom = line[1].fY;
flipped = top > bottom;
if (flipped) {
- SkTSwap<double>(top, bottom);
+ using std::swap;
+ swap(top, bottom);
}
result = intersections.vertical(cubic, top, bottom, line[0].fX, flipped);
} else if (line[0].fY == line[1].fY) {
@@ -114,7 +117,8 @@ static int doIntersect(SkIntersections& intersections, const SkDCubic& cubic, co
double right = line[1].fX;
flipped = left > right;
if (flipped) {
- SkTSwap<double>(left, right);
+ using std::swap;
+ swap(left, right);
}
result = intersections.horizontal(cubic, left, right, line[0].fY, flipped);
} else {
diff --git a/tests/PathOpsQuadLineIntersectionTest.cpp b/tests/PathOpsQuadLineIntersectionTest.cpp
index f24b2e4d7a..5bbd845d0b 100644
--- a/tests/PathOpsQuadLineIntersectionTest.cpp
+++ b/tests/PathOpsQuadLineIntersectionTest.cpp
@@ -12,6 +12,8 @@
#include "SkReduceOrder.h"
#include "Test.h"
+#include <utility>
+
static struct lineQuad {
QuadPts quad;
SkDLine line;
@@ -37,7 +39,8 @@ static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, cons
double bottom = line[1].fY;
flipped = top > bottom;
if (flipped) {
- SkTSwap<double>(top, bottom);
+ using std::swap;
+ swap(top, bottom);
}
result = intersections.vertical(quad, top, bottom, line[0].fX, flipped);
} else if (line[0].fY == line[1].fY) {
@@ -45,7 +48,8 @@ static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, cons
double right = line[1].fX;
flipped = left > right;
if (flipped) {
- SkTSwap<double>(left, right);
+ using std::swap;
+ swap(left, right);
}
result = intersections.horizontal(quad, left, right, line[0].fY, flipped);
} else {
diff --git a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
index a82ac28fde..c61589469f 100644
--- a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
+++ b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
@@ -13,6 +13,8 @@
#include "SkReduceOrder.h"
#include "SkString.h"
+#include <utility>
+
static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, const SkDLine& line,
bool& flipped) {
int result;
@@ -22,7 +24,8 @@ static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, cons
double bottom = line[1].fY;
flipped = top > bottom;
if (flipped) {
- SkTSwap<double>(top, bottom);
+ using std::swap;
+ swap(top, bottom);
}
result = intersections.vertical(quad, top, bottom, line[0].fX, flipped);
} else if (line[0].fY == line[1].fY) {
@@ -30,7 +33,8 @@ static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, cons
double right = line[1].fX;
flipped = left > right;
if (flipped) {
- SkTSwap<double>(left, right);
+ using std::swap;
+ swap(left, right);
}
result = intersections.horizontal(quad, left, right, line[0].fY, flipped);
} else {
diff --git a/tests/PathOpsTestCommon.cpp b/tests/PathOpsTestCommon.cpp
index d7db579d9c..c067d1d3e2 100644
--- a/tests/PathOpsTestCommon.cpp
+++ b/tests/PathOpsTestCommon.cpp
@@ -14,6 +14,8 @@
#include "SkReduceOrder.h"
#include "SkTSort.h"
+#include <utility>
+
static double calc_t_div(const SkDCubic& cubic, double precision, double start) {
const double adjust = sqrt(3.) / 36;
SkDCubic sub;
@@ -223,7 +225,8 @@ void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath) {
double tInflects[2];
int inflections = cubic.findInflections(tInflects);
if (inflections > 1 && tInflects[0] > tInflects[1]) {
- SkTSwap(tInflects[0], tInflects[1]);
+ using std::swap;
+ swap(tInflects[0], tInflects[1]);
}
double lo = 0;
for (int index = 0; index <= inflections; ++index) {
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]);
diff --git a/tests/TArrayTest.cpp b/tests/TArrayTest.cpp
index 5845b61f93..f80f6726e5 100644
--- a/tests/TArrayTest.cpp
+++ b/tests/TArrayTest.cpp
@@ -79,7 +79,7 @@ template <typename T> static void test_swap(skiatest::Reporter* reporter,
for (int i = 0; i < sizeA; i++) { a->push_back(curr++); }
for (int i = 0; i < sizeB; i++) { b->push_back(curr++); }
- a->swap(b);
+ a->swap(*b);
REPORTER_ASSERT(reporter, b->count() == sizeA);
REPORTER_ASSERT(reporter, a->count() == sizeB);
@@ -87,7 +87,7 @@ template <typename T> static void test_swap(skiatest::Reporter* reporter,
for (auto&& x : *b) { REPORTER_ASSERT(reporter, x == curr++); }
for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); }
- a->swap(a);
+ a->swap(*a);
curr = sizeA;
for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); }
}}