Index: src/effects/SkLightingImageFilter.cpp |
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp |
index 7223ae5a1e4a3d7cddd2e05a4b7698dc732046f4..6efb0f6c4e1a33f0fdaf7e5c6cc1e663c3588241 100644 |
--- a/src/effects/SkLightingImageFilter.cpp |
+++ b/src/effects/SkLightingImageFilter.cpp |
@@ -407,18 +407,10 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma |
sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); |
SkASSERT(inputTexture); |
- GrSurfaceDesc desc; |
- desc.fFlags = kRenderTarget_GrSurfaceFlag, |
- desc.fWidth = offsetBounds.width(); |
- desc.fHeight = offsetBounds.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()))); |
+ sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit, |
+ offsetBounds.width(), |
+ offsetBounds.height(), |
+ kRGBA_8888_GrPixelConfig)); |
if (!drawContext) { |
return nullptr; |
} |
@@ -462,7 +454,7 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma |
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height()), |
kNeedNewImageUniqueID_SpecialImage, |
- std::move(dst)); |
+ drawContext->asTexture()); |
} |
#endif |