Fix a case missed in r3198 where left/right direction of setOrthog matters (matrix computed from a degenerate quad).
git-svn-id: http://skia.googlecode.com/svn/trunk@3200 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 2951e1f..c32ee8e 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -254,8 +254,11 @@
// We could have a tolerance here, not sure if it would improve anything
if (maxD > 0) {
// Set the matrix to give (u = 0, v = distance_to_line)
- GrVec lineVec = qPts[maxEdge] - qPts[(maxEdge + 1)%3];
- lineVec.setOrthog(lineVec);
+ GrVec lineVec = qPts[(maxEdge + 1)%3] - qPts[maxEdge];
+ // when looking from the point 0 down the line we want positive
+ // distances to be to the left. This matches the non-degenerate
+ // case.
+ lineVec.setOrthog(lineVec, GrPoint::kLeft_Side);
lineVec.dot(qPts[0]);
matrix->setAll(0, 0, 0,
lineVec.fX, lineVec.fY, -lineVec.dot(qPts[maxEdge]),