Minor refactoring of GrClipMaskManager::clipMaskPreamble

https://codereview.appspot.com/6495052/



git-svn-id: http://skia.googlecode.com/svn/trunk@5342 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-08-30 11:05:08 +00:00
parent 405d0f43d8
commit 9cb5adf50d

View File

@ -557,26 +557,23 @@ bool GrClipMaskManager::clipMaskPreamble(const GrClipData& clipDataIn,
// 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
// Note: intBounds is in device (as opposed to canvas) coordinates
GrIRect devClipBounds;
clipDataIn.getConservativeBounds(rt, &devClipBounds);
clipDataIn.getConservativeBounds(rt, devResultBounds);
// need to outset a pixel since the standard bounding box computation
// path doesn't leave any room for antialiasing (esp. w.r.t. rects)
devClipBounds.outset(1, 1);
devResultBounds->outset(1, 1);
// TODO: make sure we don't outset if bounds are still 0,0 @ min
if (fAACache.canReuse(*clipDataIn.fClipStack,
devClipBounds.width(),
devClipBounds.height())) {
devResultBounds->width(),
devResultBounds->height())) {
*result = fAACache.getLastMask();
fAACache.getLastBound(devResultBounds);
return true;
}
this->setupCache(*clipDataIn.fClipStack, devClipBounds);
*devResultBounds = devClipBounds;
this->setupCache(*clipDataIn.fClipStack, *devResultBounds);
return false;
}