diff options
author | robertphillips <robertphillips@google.com> | 2016-08-22 16:13:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-22 16:13:48 -0700 |
commit | 6cfb10600250c5a67f0912694fd16719cf41ed51 (patch) | |
tree | d6723c35d115ddd17961ce1f874c395e4dedfeab /src/gpu/SkGpuDevice_drawTexture.cpp | |
parent | 0515593064334a74c1c02110ec750c0594b0dc18 (diff) |
Fix Ganesh analytic blurred rect draws
This CL does two things:
It fixes the SkBlurMaskFilterImpl::directFilterRRectMaskGPU draw path to explicitly handle rects
It fixes the SkGpuDevice::drawTextureProducerImpl draw path to provide the correct (src & device space) inputs to directFilterRRectMaskGPU.
How this was working before was that GrRRectBlurEffect::Make would reject rect-rrects and the code would fallback to
GrBlurUtils::drawPathWithMaskFilter which mapped the rect-rrect into device space correctly (of course,
the rect-ness of the path was removed at that point so it was going through the slow path).
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268583002
Review-Url: https://codereview.chromium.org/2268583002
Diffstat (limited to 'src/gpu/SkGpuDevice_drawTexture.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice_drawTexture.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp index c387574719..46a3699bb0 100644 --- a/src/gpu/SkGpuDevice_drawTexture.cpp +++ b/src/gpu/SkGpuDevice_drawTexture.cpp @@ -225,17 +225,23 @@ void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, } // First see if we can do the draw + mask filter direct to the dst. - SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); - if (mf->directFilterRRectMaskGPU(fContext, - fDrawContext.get(), - &grPaint, - clip, - viewMatrix, - rec, - SkRRect::MakeRect(clippedSrcRect), - SkRRect::MakeRect(clippedDstRect))) { - return; + if (viewMatrix.isScaleTranslate()) { + SkRect devClippedDstRect; + viewMatrix.mapRectScaleTranslate(&devClippedDstRect, clippedDstRect); + + SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); + if (mf->directFilterRRectMaskGPU(fContext, + fDrawContext.get(), + &grPaint, + clip, + viewMatrix, + rec, + SkRRect::MakeRect(clippedDstRect), + SkRRect::MakeRect(devClippedDstRect))) { + return; + } } + SkPath rectPath; rectPath.addRect(clippedDstRect); rectPath.setIsVolatile(true); |