Automatically handle converting gl_FragCoord to Skia's y-down device coords.
NOTE: THIS WILL LIKELY REQUIRE GM REBASELINING.
R=robertphillips@google.com,senorblanco@chromium.org
Review URL: https://codereview.appspot.com/6744061
git-svn-id: http://skia.googlecode.com/svn/trunk@6030 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 06d8e71..411b0e3 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -458,16 +458,7 @@
if (orthVec.setLength(SK_Scalar1)) {
orthVec.setOrthog(orthVec);
- // the values we pass down to the frag shader
- // have to be in y-points-up space;
- SkVector normal;
- normal.fX = orthVec.fX;
- normal.fY = -orthVec.fY;
- SkPoint aYDown;
- aYDown.fX = a.fX;
- aYDown.fY = rtHeight - a.fY;
-
- SkScalar lineC = -(aYDown.dot(normal));
+ SkScalar lineC = -(a.dot(orthVec));
for (int i = 0; i < kVertsPerLineSeg; ++i) {
(*vert)[i].fPos = (i < 2) ? a : b;
if (0 == i || 3 == i) {
@@ -475,8 +466,8 @@
} else {
(*vert)[i].fPos += orthVec;
}
- (*vert)[i].fLine.fA = normal.fX;
- (*vert)[i].fLine.fB = normal.fY;
+ (*vert)[i].fLine.fA = orthVec.fX;
+ (*vert)[i].fLine.fB = orthVec.fY;
(*vert)[i].fLine.fC = lineC;
}
if (NULL != toSrc) {