diff options
author | 2012-06-21 20:15:48 +0000 | |
---|---|---|
committer | 2012-06-21 20:15:48 +0000 | |
commit | c82a8b7aa4ec19fba508c394920a9e88d3e5bd12 (patch) | |
tree | b7773177447a50269e9c11de2d12774d7fc9573a /src/gpu/GrClipMaskManager.cpp | |
parent | 7aa876bfbf0cf6f2a9d19bd4669ae50658f20821 (diff) |
Fixed two bugs in SW-only clip mask generation
http://codereview.appspot.com/6306086/
git-svn-id: http://skia.googlecode.com/svn/trunk@4290 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index c16b4106a1..53221a3aa2 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -427,21 +427,6 @@ void GrClipMaskManager::drawTexture(GrTexture* target, drawState->setTexture(0, NULL); } -namespace { - -void clear(GrGpu* gpu, - GrTexture* target, - GrColor color) { - GrDrawState* drawState = gpu->drawState(); - GrAssert(NULL != drawState); - - // zap entire target to specified color - drawState->setRenderTarget(target->asRenderTarget()); - gpu->clear(NULL, color); -} - -} - // get a texture to act as a temporary buffer for AA clip boolean operations // TODO: given the expense of createTexture we may want to just cache this too void GrClipMaskManager::getTemp(const GrIRect& bounds, @@ -577,7 +562,9 @@ bool GrClipMaskManager::createAlphaClipMask(const GrClip& clipIn, &clearToInside, &startOp); - clear(fGpu, accum, clearToInside ? 0xffffffff : 0x00000000); + fGpu->clear(NULL, + clearToInside ? 0xffffffff : 0x00000000, + accum->asRenderTarget()); GrAutoScratchTexture temp; @@ -592,7 +579,7 @@ bool GrClipMaskManager::createAlphaClipMask(const GrClip& clipIn, // replace ops and alter GrClip to allow them through // clear the accumulator and draw the new object directly into it - clear(fGpu, accum, 0x00000000); + fGpu->clear(NULL, 0x00000000, accum->asRenderTarget()); setup_boolean_blendcoeffs(drawState, op); this->drawClipShape(accum, clipIn, c); @@ -613,7 +600,7 @@ bool GrClipMaskManager::createAlphaClipMask(const GrClip& clipIn, } // clear the temp target & draw into it - clear(fGpu, temp.texture(), 0x00000000); + fGpu->clear(NULL, 0x00000000, temp.texture()->asRenderTarget()); setup_boolean_blendcoeffs(drawState, SkRegion::kReplace_Op); this->drawClipShape(temp.texture(), clipIn, c); @@ -1146,11 +1133,11 @@ bool GrClipMaskManager::createSoftwareClipMask(const GrClip& clipIn, GrDrawState* drawState = fGpu->drawState(); GrAssert(NULL != drawState); GrRenderTarget* temp = drawState->getRenderTarget(); - clear(fGpu, accum, 0x00000000); + fGpu->clear(NULL, 0x00000000, accum->asRenderTarget()); // can't leave the accum bound as a rendertarget drawState->setRenderTarget(temp); - helper.toTexture(accum); + helper.toTexture(accum, clearToInside); *result = accum; |