Fix some NV path rendering issues with perspective and inverse paths
Review URL: http://codereview.appspot.com/6347050/



git-svn-id: http://skia.googlecode.com/svn/trunk@4403 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index 40d998b..81dc1db 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -95,7 +95,10 @@
         GR_STATIC_CONST_SAME_STENCIL(kInvertedStencilPass,
             kZero_StencilOp,
             kZero_StencilOp,
-            kEqual_StencilFunc,
+            // We know our rect will hit pixels outside the clip and the user bits will be 0
+            // outside the clip. So we can't just fill where the user bits are 0. We also need to
+            // check that the clip bit is set.
+            kEqualIfInClip_StencilFunc,
             0xffff,
             0x0000,
             0xffff);
@@ -106,7 +109,8 @@
         // mapRect through persp matrix may not be correct
         if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewInverse(&vmi)) {
             vmi.mapRect(&bounds);
-            // theoretically could set bloat = 0, instead leave it because of matrix inversion precision.
+            // theoretically could set bloat = 0, instead leave it because of matrix inversion
+            // precision.
         } else {
             if (stageMask) {
                 if (!drawState->getViewInverse(&vmi)) {