Reland path bounds change with correct bounds for convex and hairline path renderers.

R=robertphillips@google.com

Review URL: https://codereview.chromium.org/15465005

git-svn-id: http://skia.googlecode.com/svn/trunk@9194 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 43809ed..87deb9c 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -445,7 +445,9 @@
         }
     }
 
-    {
+    SkRect devBounds;
+    GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
+
     for (int p = 0; p < passCount; ++p) {
         drawState->setDrawFace(drawFace[p]);
         if (NULL != passes[p]) {
@@ -460,10 +462,8 @@
             GrDrawState::AutoDeviceCoordDraw adcd;
             if (reverse) {
                 GrAssert(NULL != drawState->getRenderTarget());
-                // draw over the whole world.
-                bounds.setLTRB(0, 0,
-                               SkIntToScalar(drawState->getRenderTarget()->width()),
-                               SkIntToScalar(drawState->getRenderTarget()->height()));
+                // draw over the dev bounds (which will be the whole dst surface for inv fill).
+                bounds = devBounds;
                 SkMatrix vmi;
                 // mapRect through persp matrix may not be correct
                 if (!drawState->getViewMatrix().hasPerspective() &&
@@ -483,13 +483,12 @@
             }
             if (indexCnt) {
                 target->drawIndexed(primType, 0, 0,
-                                    vertexCnt, indexCnt);
+                                    vertexCnt, indexCnt, &devBounds);
             } else {
-                target->drawNonIndexed(primType, 0, vertexCnt);
+                target->drawNonIndexed(primType, 0, vertexCnt, &devBounds);
             }
         }
     }
-    }
     return true;
 }