Chromium Code Reviews| Index: src/effects/SkBlurMaskFilter.cpp |
| diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp |
| index 556cb4469daf266a70ba890831f1278c1cc91562..7534959c6b43ae99ba0925157f81a5441d40e49c 100644 |
| --- a/src/effects/SkBlurMaskFilter.cpp |
| +++ b/src/effects/SkBlurMaskFilter.cpp |
| @@ -19,6 +19,7 @@ |
| #if SK_SUPPORT_GPU |
| #include "GrContext.h" |
| +#include "GrDrawContext.h" |
| #include "GrTexture.h" |
| #include "GrFragmentProcessor.h" |
| #include "GrInvariantOutput.h" |
| @@ -870,8 +871,14 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context, |
| if (!viewMatrix.invert(&inverse)) { |
| return false; |
| } |
| - context->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), rect, inverse); |
| - return true; |
| + |
| + GrDrawContext* drawContext = context->drawContext(); |
| + if (drawContext) { |
| + drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), rect, inverse); |
| + return true; |
| + } |
| + |
| + return false; |
| } |
| class GrRRectBlurEffect : public GrFragmentProcessor { |
| @@ -1154,8 +1161,14 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, |
| if (!viewMatrix.invert(&inverse)) { |
| return false; |
| } |
| - context->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), proxy_rect, inverse); |
| - return true; |
| + |
| + GrDrawContext* drawContext = context->drawContext(); |
| + if (drawContext) { |
| + drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), proxy_rect, inverse); |
|
bsalomon
2015/05/22 20:33:57
wrap?
robertphillips
2015/05/26 16:12:58
Done.
|
| + return true; |
| + } |
| + |
| + return false; |
| } |
| bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds, |
| @@ -1236,8 +1249,14 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, |
| // = 0 * src + (1 - src) * dst |
| paint.setCoverageSetOpXPFactory(SkRegion::kDifference_Op); |
| } |
| - context->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix::I(), |
| - clipRect); |
| + |
| + GrDrawContext* drawContext = context->drawContext(); |
| + if (!drawContext) { |
| + return false; |
| + } |
| + |
| + drawContext->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(), |
| + paint, SkMatrix::I(), clipRect); |
| } |
| return true; |