aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-13 16:39:39 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-13 16:39:39 +0000
commit439ff1b9ca2b74a9dc3b04346aa1032c11b142e9 (patch)
tree838c3663ad6d39a2efcaedab43e9d9297ffae72e
parent6077057cae9f92b45e044ee1202d83fd9ce9d424 (diff)
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
-rw-r--r--expectations/gm/ignored-tests.txt4
-rw-r--r--src/effects/SkBlurMaskFilter.cpp5
-rw-r--r--src/gpu/SkGpuDevice.cpp7
3 files changed, 10 insertions, 6 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 4e5f56cf40..612695382f 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 f4d032f08f..fa31743bb3 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -541,7 +541,7 @@ bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds,
}
bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
- const SkMatrix& matrix,
+ const SkMatrix& ctm,
const SkRect& maskRect,
GrTexture** result,
bool canOverwriteSrc) const {
@@ -551,8 +551,7 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
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 39f9ef3d7c..36e76e9940 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -922,6 +922,10 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
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 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
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);