Revert "Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage directly into an A8 target, regardless of the previous pixel values.""

This reverts commit 3c77887b3eb2d32ab668ab4e5f2f9e79103956e8.

BUG=

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

git-svn-id: http://skia.googlecode.com/svn/trunk/include@12167 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkDraw.h b/core/SkDraw.h
index 772e11e..9183094 100644
--- a/core/SkDraw.h
+++ b/core/SkDraw.h
@@ -43,8 +43,15 @@
      *  affect the geometry/rasterization, then the pre matrix can just be
      *  pre-concated with the current matrix.
      */
-    void    drawPath(const SkPath& srcPath, const SkPaint&,
-                     const SkMatrix* prePathMatrix, bool pathIsMutable) const;
+    void    drawPath(const SkPath& path, const SkPaint& paint,
+                     const SkMatrix* prePathMatrix, bool pathIsMutable) const {
+        this->drawPath(path, paint, prePathMatrix, pathIsMutable, false);
+    }
+
+    void drawPath(const SkPath& path, const SkPaint& paint) const {
+        this->drawPath(path, paint, NULL, false, false);
+    }
+
     void    drawBitmap(const SkBitmap&, const SkMatrix&, const SkPaint&) const;
     void    drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const;
     void    drawText(const char text[], size_t byteLength, SkScalar x,
@@ -65,8 +72,14 @@
                          const uint16_t indices[], int ptCount,
                          const SkPaint& paint) const;
 
-    void drawPath(const SkPath& src, const SkPaint& paint) const {
-        this->drawPath(src, paint, NULL, false);
+    /**
+     *  Overwrite the target with the path's coverage (i.e. its mask).
+     *  Will overwrite the entire device, so it need not be zero'd first.
+     *
+     *  Only device A8 is supported right now.
+     */
+    void drawPathCoverage(const SkPath& src, const SkPaint& paint) const {
+        this->drawPath(src, paint, NULL, false, true);
     }
 
     /** Helper function that creates a mask from a path and an optional maskfilter.
@@ -107,6 +120,9 @@
     void    drawDevMask(const SkMask& mask, const SkPaint&) const;
     void    drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;
 
+    void    drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
+                     bool pathIsMutable, bool drawCoverage) const;
+
     /**
      *  Return the current clip bounds, in local coordinates, with slop to account
      *  for antialiasing or hairlines (i.e. device-bounds outset by 1, and then
diff --git a/core/SkRect.h b/core/SkRect.h
index 98acb1c..8bfa57a 100644
--- a/core/SkRect.h
+++ b/core/SkRect.h
@@ -730,7 +730,7 @@
 
     /**
      *  Set the dst rectangle by rounding this rectangle's coordinates to their
-     *  nearest integer values using SkScalarRound.
+     *  nearest integer values using SkScalarRoundToInt.
      */
     void round(SkIRect* dst) const {
         SkASSERT(dst);
@@ -772,6 +772,15 @@
                  SkScalarFloorToInt(fRight), SkScalarFloorToInt(fBottom));
     }
 
+    /**
+     *  Return a new SkIRect which is contains the rounded coordinates of this
+     *  rect using SkScalarRoundToInt.
+     */
+    SkIRect round() const {
+        SkIRect ir;
+        this->round(&ir);
+        return ir;
+    }
 
     /**
      *  Swap top/bottom or left/right if there are flipped (i.e. if width()