Detect inverse-fill, and treat its bounds as huge (all of integer space) for the
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 8 Jun 2012 16:30:12 +0000 (16:30 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 8 Jun 2012 16:30:12 +0000 (16:30 +0000)
purposes of comparing w/ the clip-bounds, otherwise we can reject the draw if
the bounds of the path are outside the bounds of the clip.
Review URL: https://codereview.appspot.com/6302058

git-svn-id: http://skia.googlecode.com/svn/trunk@4214 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkScan_Path.cpp

index 5450ea0..8973397 100644 (file)
@@ -540,6 +540,14 @@ void sk_blit_below(SkBlitter* blitter, const SkIRect& ir, const SkRegion& clip)
 
 ///////////////////////////////////////////////////////////////////////////////
 
+static const SkIRect gHugeIRect = {
+    SK_MinS32, SK_MinS32, SK_MaxS32, SK_MaxS32
+};
+
+/**
+ *  If the caller is drawing an inverse-fill path, then it shouldn't pass a
+ *  huge rect for ir, since the path draws "everywhere".
+ */
 SkScanClipper::SkScanClipper(SkBlitter* blitter, const SkRegion* clip,
                              const SkIRect& ir) {
     fBlitter = NULL;     // null means blit nothing
@@ -610,7 +618,8 @@ void SkScan::FillPath(const SkPath& path, const SkRegion& origClip,
         return;
     }
 
-    SkScanClipper   clipper(blitter, clipPtr, ir);
+    SkScanClipper clipper(blitter, clipPtr,
+                          path.isInverseFillType() ? gHugeIRect : ir);
 
     blitter = clipper.getBlitter();
     if (blitter) {