aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipMaskManager.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 18:20:35 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 18:20:35 +0000
commit3e11c0bd92fbd12f59080c3f9450201d6105db83 (patch)
treebb15f72ed57cdf90f36f23e7e9d73b0ad1404a39 /src/gpu/GrClipMaskManager.cpp
parentad5e937c110efaf9630159d2859fabc4f38f7ab2 (diff)
Forced GrClip to always have conservative bounds
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp35
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;