diff options
author | 2012-07-26 21:37:40 +0000 | |
---|---|---|
committer | 2012-07-26 21:37:40 +0000 | |
commit | e4d69c0e46c1a000eb89ef950bdaf0aea680a816 (patch) | |
tree | 79e686956e5dc1bfdf0d7743913310a3875f09e7 /src/gpu/GrClipMaskManager.cpp | |
parent | 99547767e9cdabcdae6a575f0f6bfde01d809865 (diff) |
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
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 25 |
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) |