Fix a case missed in r3198 where left/right direction of setOrthog matters (matrix...
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 15 Feb 2012 18:49:41 +0000 (18:49 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 15 Feb 2012 18:49:41 +0000 (18:49 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3200 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrPathUtils.cpp

index 2951e1f..c32ee8e 100644 (file)
@@ -254,8 +254,11 @@ void GrPathUtils::quadDesignSpaceToUVCoordsMatrix(const SkPoint qPts[3],
         // 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]),