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-26 21:37:40 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-26 21:37:40 +0000
commite4d69c0e46c1a000eb89ef950bdaf0aea680a816 (patch)
tree79e686956e5dc1bfdf0d7743913310a3875f09e7 /src/gpu/GrClipMaskManager.cpp
parent99547767e9cdabcdae6a575f0f6bfde01d809865 (diff)
Added getConservativeBound helper function to GrClipData
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index a3c8537737..ea5a2cd693 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -147,16 +147,9 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn) {
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 @@ bool GrClipMaskManager::clipMaskPreamble(const GrClipData& clipDataIn,
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)