Fix clipping problem in GPU-based blur. The FBOs used for the fast Gaussian
blur were being clipped to the size of the output window, causing the blurred
primitive to be truncated if the FBO was larger than the output window. Clip
them to the srcRect instead, and restore when done.
Review URL: http://codereview.appspot.com/4695057/
git-svn-id: http://skia.googlecode.com/svn/trunk@1859 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index eaf88b0..22cbaf0 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -892,7 +892,11 @@
return false;
}
GrRenderTarget* oldRenderTarget = context->getRenderTarget();
+ // Once this code moves into GrContext, this should be changed to use
+ // an AutoClipRestore.
+ GrClip oldClip = context->getClip();
context->setRenderTarget(dstTexture->asRenderTarget());
+ context->setClip(srcRect);
// FIXME: could just clear bounds
context->clear(NULL, 0);
GrMatrix transM;
@@ -1006,6 +1010,7 @@
context->drawRect(paint, srcRect);
}
context->setRenderTarget(oldRenderTarget);
+ context->setClip(oldClip);
if (grp->hasTextureOrMask()) {
GrMatrix inverse;