aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkEdgeClipper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkEdgeClipper.cpp')
-rw-r--r--src/core/SkEdgeClipper.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/SkEdgeClipper.cpp b/src/core/SkEdgeClipper.cpp
index b2b95fc78e..cbb0327114 100644
--- a/src/core/SkEdgeClipper.cpp
+++ b/src/core/SkEdgeClipper.cpp
@@ -10,6 +10,8 @@
#include "SkLineClipper.h"
#include "SkMacros.h"
+#include <utility>
+
static bool quick_reject(const SkRect& bounds, const SkRect& clip) {
return bounds.fTop >= clip.fBottom || bounds.fBottom <= clip.fTop;
}
@@ -152,7 +154,8 @@ void SkEdgeClipper::clipMonoQuad(const SkPoint srcPts[3], const SkRect& clip) {
chop_quad_in_Y(pts, clip);
if (pts[0].fX > pts[2].fX) {
- SkTSwap<SkPoint>(pts[0], pts[2]);
+ using std::swap;
+ swap(pts[0], pts[2]);
reverse = !reverse;
}
SkASSERT(pts[0].fX <= pts[1].fX);
@@ -342,8 +345,9 @@ void SkEdgeClipper::clipMonoCubic(const SkPoint src[4], const SkRect& clip) {
chop_cubic_in_Y(pts, clip);
if (pts[0].fX > pts[3].fX) {
- SkTSwap<SkPoint>(pts[0], pts[3]);
- SkTSwap<SkPoint>(pts[1], pts[2]);
+ using std::swap;
+ swap(pts[0], pts[3]);
+ swap(pts[1], pts[2]);
reverse = !reverse;
}
@@ -453,12 +457,12 @@ void SkEdgeClipper::appendLine(SkPoint p0, SkPoint p1) {
fCurrPoint += 2;
}
-void SkEdgeClipper::appendVLine(SkScalar x, SkScalar y0, SkScalar y1,
- bool reverse) {
+void SkEdgeClipper::appendVLine(SkScalar x, SkScalar y0, SkScalar y1, bool reverse) {
*fCurrVerb++ = SkPath::kLine_Verb;
if (reverse) {
- SkTSwap<SkScalar>(y0, y1);
+ using std::swap;
+ swap(y0, y1);
}
fCurrPoint[0].set(x, y0);
fCurrPoint[1].set(x, y1);