Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index d0042527e48c29381c0a93fc94e1d98981d5fe31..ed6d14ac147b7464814f18188168c689712faf90 100644 |
--- a/src/core/SkImageFilter.cpp |
+++ b/src/core/SkImageFilter.cpp |
@@ -280,9 +280,18 @@ |
paint.addColorFragmentProcessor(fp.get()); |
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit, |
- bounds.width(), bounds.height(), |
- kRGBA_8888_GrPixelConfig)); |
+ GrSurfaceDesc desc; |
+ desc.fFlags = kRenderTarget_GrSurfaceFlag; |
+ desc.fWidth = bounds.width(); |
+ desc.fHeight = bounds.height(); |
+ desc.fConfig = kRGBA_8888_GrPixelConfig; |
+ |
+ sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc)); |
+ if (!dst) { |
+ return nullptr; |
+ } |
+ |
+ sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget()))); |
if (!drawContext) { |
return nullptr; |
} |
@@ -294,7 +303,7 @@ |
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()), |
kNeedNewImageUniqueID_SpecialImage, |
- drawContext->asTexture()); |
+ std::move(dst)); |
} |
#endif |