aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice_drawTexture.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-08-22 16:13:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-22 16:13:48 -0700
commit6cfb10600250c5a67f0912694fd16719cf41ed51 (patch)
treed6723c35d115ddd17961ce1f874c395e4dedfeab /src/gpu/SkGpuDevice_drawTexture.cpp
parent0515593064334a74c1c02110ec750c0594b0dc18 (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.cpp26
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);