Use correct matrix to adjust blur radius for gpu
BUG=skia:1998
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/134973002
git-svn-id: http://skia.googlecode.com/svn/trunk@13047 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 4e5f56c..6126953 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -34,7 +34,9 @@
#gradtext_gpu
# Added for skbug.com/1998 by bsalomon. Will require rebaselining when changes are complete.
-bleed
+bleed_gpu
+blurrects_gpu
+simpleblurroundrect_gpu
# Added by sugoi for added test in https://codereview.chromium.org/104853005
displacement
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index f4d032f..fa31743 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -541,7 +541,7 @@
}
bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
- const SkMatrix& matrix,
+ const SkMatrix& ctm,
const SkRect& maskRect,
GrTexture** result,
bool canOverwriteSrc) const {
@@ -551,8 +551,7 @@
GrContext::AutoWideOpenIdentityDraw awo(context, NULL);
- // FIXME: This isn't the right matrix.
- SkScalar xformedSigma = this->computeXformedSigma(context->getMatrix());
+ SkScalar xformedSigma = this->computeXformedSigma(ctm);
SkASSERT(xformedSigma > 0);
// If we're doing a normal blur, we can clobber the pathTexture in the
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 39f9ef3..36e76e9 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -922,6 +922,10 @@
draw.fClip->getBounds(),
fContext->getMatrix(),
&maskRect)) {
+ // The context's matrix may change while creating the mask, so save the CTM here to
+ // pass to filterMaskGPU.
+ const SkMatrix ctm = fContext->getMatrix();
+
SkIRect finalIRect;
maskRect.roundOut(&finalIRect);
if (draw.fClip->quickReject(finalIRect)) {
@@ -940,8 +944,7 @@
GrTexture* filtered;
if (paint.getMaskFilter()->filterMaskGPU(mask.texture(),
- fContext->getMatrix(), maskRect,
- &filtered, true)) {
+ ctm, maskRect, &filtered, true)) {
// filterMaskGPU gives us ownership of a ref to the result
SkAutoTUnref<GrTexture> atu(filtered);