fix incorrect GPU rendering for path inverse fill when path is outside the clip
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 19 Jun 2012 13:22:45 +0000 (13:22 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 19 Jun 2012 13:22:45 +0000 (13:22 +0000)
Committed on behalf of Guanqun.Lu@gmail.com

Review URL: http://codereview.appspot.com/6296087/

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

src/gpu/GrSoftwarePathRenderer.cpp

index 1213c41..3122162 100644 (file)
@@ -86,9 +86,12 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target,
         GrIRect pathIBounds;
         pathSBounds.roundOut(&pathIBounds);
         if (!pathBounds->intersect(pathIBounds)) {
+            // set the correct path bounds, as this would be used later.
+            *pathBounds = pathIBounds;
             return false;
         }
     } else {
+        *pathBounds = GrIRect::EmptyIRect();
         return false;
     }
     return true;
@@ -305,7 +308,11 @@ bool GrSoftwarePathRenderer::onDrawPath(const SkPath& path,
     GrIRect pathBounds, clipBounds;
     if (!get_path_and_clip_bounds(target, path, translate,
                                   &pathBounds, &clipBounds)) {
-        return true;    // path is empty so there is nothing to do
+        if (GrIsFillInverted(fill)) {
+            draw_around_inv_path(target, stageMask,
+                                 clipBounds, pathBounds);
+        }
+        return true;
     }
     if (sw_draw_path_to_mask_texture(path, pathBounds,
                                      fill, fContext,