diff options
author | 2012-07-11 18:20:35 +0000 | |
---|---|---|
committer | 2012-07-11 18:20:35 +0000 | |
commit | 3e11c0bd92fbd12f59080c3f9450201d6105db83 (patch) | |
tree | bb15f72ed57cdf90f36f23e7e9d73b0ad1404a39 /src/gpu/GrClipMaskManager.cpp | |
parent | ad5e937c110efaf9630159d2859fabc4f38f7ab2 (diff) |
Forced GrClip to always have conservative bounds
http://codereview.appspot.com/6353089/
git-svn-id: http://skia.googlecode.com/svn/trunk@4545 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index dcd32ddffd..7c54009cdb 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -114,17 +114,13 @@ bool GrClipMaskManager::setupClipping(const GrClip& clipIn) { GrIRect bounds; GrIRect rtRect; rtRect.setLTRB(0, 0, rt->width(), rt->height()); - if (clipIn.hasConservativeBounds()) { - GrRect softBounds = clipIn.getConservativeBounds(); - softBounds.roundOut(&bounds); - if (!bounds.intersect(rtRect)) { - bounds.setEmpty(); - } - if (bounds.isEmpty()) { - return false; - } - } else { - bounds = rtRect; + + clipIn.getConservativeBounds().roundOut(&bounds); + if (!bounds.intersect(rtRect)) { + bounds.setEmpty(); + } + if (bounds.isEmpty()) { + return false; } #if GR_SW_CLIP @@ -503,18 +499,11 @@ bool GrClipMaskManager::clipMaskPreamble(const GrClip& clipIn, // unlike the stencil path the alpha path is not bound to the size of the // render target - determine the minimum size required for the mask - GrRect bounds; - - if (clipIn.hasConservativeBounds()) { - bounds = clipIn.getConservativeBounds(); - if (!bounds.intersect(rtRect)) { - // the mask will be empty in this case - GrAssert(false); - bounds.setEmpty(); - } - } else { - // still locked to the size of the render target - bounds = rtRect; + GrRect bounds = clipIn.getConservativeBounds(); + if (!bounds.intersect(rtRect)) { + // the mask will be empty in this case + GrAssert(false); + bounds.setEmpty(); } GrIRect intBounds; |