From 20e542e00eccaf7b9e81964692a47086e6aaf568 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 15 Feb 2012 18:49:41 +0000 Subject: [PATCH] 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 --- src/gpu/GrPathUtils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp index 2951e1f72c..c32ee8e30a 100644 --- a/src/gpu/GrPathUtils.cpp +++ b/src/gpu/GrPathUtils.cpp @@ -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]),