diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-08 16:30:12 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-08 16:30:12 +0000 |
commit | 97caebc7462c202ab0ec5cce4eb26a616930813e (patch) | |
tree | 7c8b42bd884e2bb48a5f335946109429b561eb3f /src/core | |
parent | b073d920c90bc95f6c216327acd321a4fc809bfa (diff) |
Detect inverse-fill, and treat its bounds as huge (all of integer space) for the
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
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkScan_Path.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp index 5450ea0870..8973397760 100644 --- a/src/core/SkScan_Path.cpp +++ b/src/core/SkScan_Path.cpp @@ -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) { |