explicitly pass bounds.top to the edgelist walker, so we don't leave any gaps
when the path is in an inverse fillmode, and its top or bottom are on a
fractional boundary. (thanks senorblanco)



git-svn-id: http://skia.googlecode.com/svn/trunk@504 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkScanPriv.h b/src/core/SkScanPriv.h
index 43dfdef..74c2ee7 100644
--- a/src/core/SkScanPriv.h
+++ b/src/core/SkScanPriv.h
@@ -37,7 +37,7 @@
 
 // clipRect == null means path is entirely inside the clip
 void sk_fill_path(const SkPath& path, const SkIRect* clipRect,
-                  SkBlitter* blitter, int stop_y, int shiftEdgesUp,
+                  SkBlitter* blitter, int start_y, int stop_y, int shiftEdgesUp,
                   const SkRegion& clipRgn);
 
 // blit the rects above and below avoid, clipped to clp
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 7b24f73..21fd5c9 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -412,11 +412,11 @@
     {
         MaskSuperBlitter    superBlit(blitter, ir, clip);
         SkASSERT(SkIntToScalar(ir.fTop) <= path.getBounds().fTop);
-        sk_fill_path(path, superClipRect, &superBlit, ir.fBottom, SHIFT, clip);
+        sk_fill_path(path, superClipRect, &superBlit, ir.fTop, ir.fBottom, SHIFT, clip);
     }
     else
     {
         SuperBlitter    superBlit(blitter, ir, clip);
-        sk_fill_path(path, superClipRect, &superBlit, ir.fBottom, SHIFT, clip);
+        sk_fill_path(path, superClipRect, &superBlit, ir.fTop, ir.fBottom, SHIFT, clip);
     }
 }
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 9751d2a..38f16e6 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -127,11 +127,12 @@
 #define PREPOST_END     false
 
 static void walk_edges(SkEdge* prevHead, SkPath::FillType fillType,
-                       SkBlitter* blitter, int stop_y, PrePostProc proc)
+                       SkBlitter* blitter, int start_y, int stop_y,
+                       PrePostProc proc)
 {
     validate_sort(prevHead->fNext);
 
-    int curr_y = prevHead->fNext->fFirstY;
+    int curr_y = start_y;
     // returns 1 for evenodd, -1 for winding, regardless of inverse-ness
     int windingMask = (fillType & 1) ? 1 : -1;
 
@@ -476,7 +477,7 @@
 // clipRect (if no null) has already been shifted up
 //
 void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitter,
-                  int stop_y, int shiftEdgesUp, const SkRegion& clipRgn)
+                  int start_y, int stop_y, int shiftEdgesUp, const SkRegion& clipRgn)
 {
     SkASSERT(&path && blitter);
 
@@ -527,7 +528,11 @@
 
     // now edge is the head of the sorted linklist
 
+    start_y <<= shiftEdgesUp;
     stop_y <<= shiftEdgesUp;
+    if (clipRect && start_y < clipRect->fTop) {
+        start_y = clipRect->fTop;
+    }
     if (clipRect && stop_y > clipRect->fBottom) {
         stop_y = clipRect->fBottom;
     }
@@ -541,7 +546,7 @@
         proc = PrePostInverseBlitterProc;
     }
 
-    walk_edges(&headEdge, path.getFillType(), blitter, stop_y, proc);
+    walk_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, proc);
 }
 
 void sk_blit_above_and_below(SkBlitter* blitter, const SkIRect& ir,
@@ -625,7 +630,7 @@
         if (path.isInverseFillType()) {
             sk_blit_above_and_below(blitter, ir, clip);
         }
-        sk_fill_path(path, clipper.getClipRect(), blitter, ir.fBottom, 0, clip);
+        sk_fill_path(path, clipper.getClipRect(), blitter, ir.fTop, ir.fBottom, 0, clip);
     } else {
         // what does it mean to not have a blitter if path.isInverseFillType???
     }
@@ -685,7 +690,11 @@
     if (clipRect && stop_y > clipRect->fBottom) {
         stop_y = clipRect->fBottom;
     }
-    walk_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, stop_y, NULL);
+    int start_y = ir.fTop;
+    if (clipRect && start_y < clipRect->fTop) {
+        start_y = clipRect->fTop;
+    }
+    walk_edges(&headEdge, SkPath::kEvenOdd_FillType, blitter, start_y, stop_y, NULL);
 }
 
 void SkScan::FillTriangle(const SkPoint pts[], const SkRegion* clip,