Index: src/effects/SkXfermodeImageFilter.cpp |
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp |
index 1b3cf8197c91e597c6203b6a36f4ef2b948fd136..7452f9f8e5236d769d4aea408aeb3ace857f5c9d 100644 |
--- a/src/effects/SkXfermodeImageFilter.cpp |
+++ b/src/effects/SkXfermodeImageFilter.cpp |
@@ -18,6 +18,7 @@ |
#if SK_SUPPORT_GPU |
#include "GrContext.h" |
#include "GrRenderTargetContext.h" |
+#include "GrTextureProxy.h" |
#include "effects/GrConstColorProcessor.h" |
#include "effects/GrTextureDomain.h" |
#include "effects/GrSimpleTextureEffect.h" |
@@ -253,7 +254,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( |
-SkIntToScalar(backgroundOffset.fY)); |
bgFP = GrTextureDomainEffect::Make( |
backgroundTex.get(), nullptr, backgroundMatrix, |
- GrTextureDomain::MakeTexelDomain(backgroundTex.get(), |
+ GrTextureDomain::MakeTexelDomain(backgroundTex->width(), |
+ backgroundTex->height(), |
background->subset()), |
GrTextureDomain::kDecal_Mode, |
GrTextureParams::kNone_FilterMode); |
@@ -272,7 +274,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( |
foregroundFP = GrTextureDomainEffect::Make( |
foregroundTex.get(), nullptr, foregroundMatrix, |
- GrTextureDomain::MakeTexelDomain(foregroundTex.get(), |
+ GrTextureDomain::MakeTexelDomain(foregroundTex->width(), |
+ foregroundTex->height(), |
foreground->subset()), |
GrTextureDomain::kDecal_Mode, |
GrTextureParams::kNone_FilterMode); |
@@ -291,7 +294,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( |
paint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
- sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext( |
+ sk_sp<GrRenderTargetContext> renderTargetContext(context->makeDeferredRenderTargetContext( |
SkBackingFit::kApprox, bounds.width(), bounds.height(), |
GrRenderableConfigForColorSpace(outputProperties.colorSpace()), |
sk_ref_sp(outputProperties.colorSpace()))); |
@@ -304,10 +307,10 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( |
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top())); |
renderTargetContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); |
- return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()), |
- kNeedNewImageUniqueID_SpecialImage, |
- renderTargetContext->asTexture(), |
- sk_ref_sp(renderTargetContext->getColorSpace())); |
+ return SkSpecialImage::MakeDeferredFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()), |
+ kNeedNewImageUniqueID_SpecialImage, |
+ renderTargetContext->asDeferredTexture(), |
+ sk_ref_sp(renderTargetContext->getColorSpace())); |
} |
sk_sp<GrFragmentProcessor> |