aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/SkLightingImageFilter.cpp')
-rw-r--r--src/effects/SkLightingImageFilter.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 6efb0f6c4e..7223ae5a1e 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -407,10 +407,18 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
sk_sp<GrTexture> inputTexture(input->asTextureRef(context));
SkASSERT(inputTexture);
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit,
- offsetBounds.width(),
- offsetBounds.height(),
- kRGBA_8888_GrPixelConfig));
+ 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())));
if (!drawContext) {
return nullptr;
}
@@ -454,7 +462,7 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- drawContext->asTexture());
+ std::move(dst));
}
#endif