Index: src/effects/SkXfermodeImageFilter.cpp |
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp |
index b1ac1c32e08ac9c20bc8eed444f350f3056080eb..b1e19bbec3e207e82db9617473baa8f8e02fde5a 100644 |
--- a/src/effects/SkXfermodeImageFilter.cpp |
+++ b/src/effects/SkXfermodeImageFilter.cpp |
@@ -176,16 +176,6 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour |
foregroundTex = foreground->asTextureRef(context); |
} |
- GrSurfaceDesc desc; |
- desc.fFlags = kRenderTarget_GrSurfaceFlag; |
- desc.fWidth = bounds.width(); |
- desc.fHeight = bounds.height(); |
- desc.fConfig = kSkia8888_GrPixelConfig; |
- sk_sp<GrTexture> dst(context->textureProvider()->createApproxTexture(desc)); |
- if (!dst) { |
- return nullptr; |
- } |
- |
GrPaint paint; |
// SRGBTODO: AllowSRGBInputs? |
SkAutoTUnref<const GrFragmentProcessor> bgFP; |
@@ -236,11 +226,11 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour |
mode.reset(new SkProcCoeffXfermode(rec, SkXfermode::kSrcOver_Mode)); |
} |
- SkAutoTUnref<const GrFragmentProcessor> xferFP(mode->getFragmentProcessorForImageFilter(bgFP)); |
+ sk_sp<const GrFragmentProcessor> xferFP(mode->getFragmentProcessorForImageFilter(bgFP)); |
// A null 'xferFP' here means kSrc_Mode was used in which case we can just proceed |
if (xferFP) { |
- paint.addColorFragmentProcessor(xferFP); |
+ paint.addColorFragmentProcessor(xferFP.get()); |
} |
} else { |
paint.addColorFragmentProcessor(bgFP); |
@@ -248,7 +238,9 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour |
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
- sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRenderTarget()))); |
+ sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_BackingFit, |
+ bounds.width(), bounds.height(), |
+ kSkia8888_GrPixelConfig)); |
if (!drawContext) { |
return nullptr; |
} |
@@ -259,7 +251,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour |
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()), |
kNeedNewImageUniqueID_SpecialImage, |
- std::move(dst)); |
+ drawContext->asTexture()); |
} |
#endif |