Revert of Add device space "nudge" to gpu draws (patchset #6 id:90001 of https://codereview.chromium.org/877473005/)

Reason for revert:
Blink layout tests this time :(

Original issue's description:
> Add device space "nudge" to gpu draws
>
> This CL nudges all the GPU draws and clips slightly to match raster's round behavior for BW draws. We assume the effect will be negligible and do it for AA draws too.
>
> BUG=423834
>
> Committed: https://skia.googlesource.com/skia/+/2d55d07501c56310f97d2092d789a2bc9fa01b78
>
> Committed: https://skia.googlesource.com/skia/+/b9329991426d0b77ea194a380d72d73fb855308a

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=423834

Review URL: https://codereview.chromium.org/886153002
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 863dc9a..515596a 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -418,6 +418,19 @@
             break;
     }
 
+    if (!fDoAA) {
+        // Here we mimic a non-anti-aliased scanline system. If there is
+        // no anti-aliasing we can integerize the bounding box to exclude
+        // fractional parts that won't be rendered.
+        // Note: the left edge is handled slightly differently below. We
+        // are a bit more generous in the rounding since we don't want to
+        // risk missing the left pixels when fLeft is very close to .5
+        fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f),
+                         SkScalarRoundToScalar(fFiniteBound.fTop),
+                         SkScalarRoundToScalar(fFiniteBound.fRight),
+                         SkScalarRoundToScalar(fFiniteBound.fBottom));
+    }
+
     // Now determine the previous Element's bound information taking into
     // account that there may be no previous clip
     SkRect prevFinite;
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 615c341..7035094 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -137,14 +137,10 @@
         fsBuilder->codeAppendf("\t\tfloat alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));\n");
     } else {
         fsBuilder->codeAppendf("\t\tfloat alpha = 1.0;\n");
-        fsBuilder->codeAppendf("\t\talpha *= (%s.x - %s.x) > -0.5 ? 1.0 : 0.0;\n",
-                               fragmentPos, rectName);
-        fsBuilder->codeAppendf("\t\talpha *= (%s.z - %s.x) > -0.5 ? 1.0 : 0.0;\n",
-                               rectName, fragmentPos);
-        fsBuilder->codeAppendf("\t\talpha *= (%s.y - %s.y) > -0.5 ? 1.0 : 0.0;\n",
-                               fragmentPos, rectName);
-        fsBuilder->codeAppendf("\t\talpha *= (%s.w - %s.y) > -0.5 ? 1.0 : 0.0;\n",
-                               rectName, fragmentPos);
+        fsBuilder->codeAppendf("\t\talpha *= (%s.x - %s.x) > -0.5 ? 1.0 : 0.0;\n", fragmentPos, rectName);
+        fsBuilder->codeAppendf("\t\talpha *= (%s.z - %s.x) > -0.5 ? 1.0 : 0.0;\n", rectName, fragmentPos);
+        fsBuilder->codeAppendf("\t\talpha *= (%s.y - %s.y) > -0.5 ? 1.0 : 0.0;\n", fragmentPos, rectName);
+        fsBuilder->codeAppendf("\t\talpha *= (%s.w - %s.y) > -0.5 ? 1.0 : 0.0;\n", rectName, fragmentPos);
     }
 
     if (GrProcessorEdgeTypeIsInverseFill(aare.getEdgeType())) {
@@ -158,10 +154,8 @@
     const AARectEffect& aare = processor.cast<AARectEffect>();
     const SkRect& rect = aare.getRect();
     if (rect != fPrevRect) {
-        // Add a device space "nudge" of 0.05f, 0.05f to match raster's rounding behavior for
-        // BW clipping/drawing
-        pdman.set4f(fRectUniform, rect.fLeft + 0.55f, rect.fTop + 0.55f,
-                                  rect.fRight - 0.45f, rect.fBottom - 0.45f);
+        pdman.set4f(fRectUniform, rect.fLeft + 0.5f, rect.fTop + 0.5f,
+                   rect.fRight - 0.5f, rect.fBottom - 0.5f);
         fPrevRect = rect;
     }
 }
@@ -227,10 +221,7 @@
     fsBuilder->codeAppend("\t\tfloat edge;\n");
     const char* fragmentPos = fsBuilder->fragmentPosition();
     for (int i = 0; i < cpe.getEdgeCount(); ++i) {
-        // Add a device space "nudge" of 0.05f, 0.05f to match raster's rounding behavior for
-        // BW clipping/drawing. Since we are "nudging" fragment positions we have to go in
-        // the opposite direction.
-        fsBuilder->codeAppendf("\t\tedge = dot(%s[%d], vec3(%s.x - 0.05, %s.y - 0.05, 1));\n",
+        fsBuilder->codeAppendf("\t\tedge = dot(%s[%d], vec3(%s.x, %s.y, 1));\n",
                                edgeArrayName, i, fragmentPos, fragmentPos);
         if (GrProcessorEdgeTypeIsAA(cpe.getEdgeType())) {
             fsBuilder->codeAppend("\t\tedge = clamp(edge, 0.0, 1.0);\n");
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index f0b645e..f17e741 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -47,15 +47,13 @@
     // Transform from Skia's device coords to GL's normalized device coords. Note that
     // because we want to "nudge" the device space positions we are converting to 
     // non-homogeneous NDC.
-    // The "0.05" nudge serves to match the raster path's rounding for bw draws.
-    // For aa draws we just assume the impact will be minimal - so we always perform the nudge.
     if (kVec3f_GrSLType == posVar.getType()) {
-        this->codeAppendf("gl_Position = vec4((dot(%s.xz, %s.xy)/%s.z) + 0.05 * %s.x, (dot(%s.yz, %s.zw)/%s.z) + 0.05 * %s.z, 0, 1);",
-                          posVar.c_str(), fRtAdjustName, posVar.c_str(), fRtAdjustName,
-                          posVar.c_str(), fRtAdjustName, posVar.c_str(), fRtAdjustName);
+        this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy)/%s.z, dot(%s.yz, %s.zw)/%s.z, 0, 1);",
+                          posVar.c_str(), fRtAdjustName, posVar.c_str(),
+                          posVar.c_str(), fRtAdjustName, posVar.c_str());
     } else {
         SkASSERT(kVec2f_GrSLType == posVar.getType());
-        this->codeAppendf("gl_Position = vec4((%s.x + 0.05) * %s.x + %s.y, (%s.y + 0.05) * %s.z + %s.w, 0, 1);",
+        this->codeAppendf("gl_Position = vec4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);",
                           posVar.c_str(), fRtAdjustName, fRtAdjustName,
                           posVar.c_str(), fRtAdjustName, fRtAdjustName);
     }