Added getConservativeBound helper function to GrClipData
http://codereview.appspot.com/6454054/
git-svn-id: http://skia.googlecode.com/svn/trunk@4798 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index a3c8537..ea5a2cd 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -147,16 +147,9 @@
GrAssert(NULL != rt);
GrIRect bounds;
- GrIRect rtRect;
- rtRect.setLTRB(0, 0, rt->width(), rt->height());
+ bool isIntersectionOfRects = false;
-
- GrRect conservativeBounds = clipDataIn->fClipStack->getConservativeBounds();
-
- conservativeBounds.roundOut(&bounds);
- if (!bounds.intersect(rtRect)) {
- bounds.setEmpty();
- }
+ clipDataIn->getConservativeBounds(rt, &bounds, &isIntersectionOfRects);
if (bounds.isEmpty()) {
return false;
}
@@ -542,22 +535,10 @@
GrRenderTarget* rt = origDrawState->getRenderTarget();
GrAssert(NULL != rt);
- GrRect rtRect;
- rtRect.setLTRB(0, 0,
- GrIntToScalar(rt->width()), GrIntToScalar(rt->height()));
-
// 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 = clipDataIn.fClipStack->getConservativeBounds();
-
- if (!bounds.intersect(rtRect)) {
- // the mask will be empty in this case
- GrAssert(false);
- bounds.setEmpty();
- }
-
GrIRect intBounds;
- bounds.roundOut(&intBounds);
+ clipDataIn.getConservativeBounds(rt, &intBounds);
// need to outset a pixel since the standard bounding box computation
// path doesn't leave any room for antialiasing (esp. w.r.t. rects)