Index: src/effects/SkAlphaThresholdFilter.cpp |
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp |
index 167489b68974ca4dd703d773d28b7f9b0d885217..17ec57a18a1cdae215af7802add436da29ba1c9c 100644 |
--- a/src/effects/SkAlphaThresholdFilter.cpp |
+++ b/src/effects/SkAlphaThresholdFilter.cpp |
@@ -29,8 +29,8 @@ protected: |
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
SkBitmap* result, SkIPoint* offset) const override; |
#if SK_SUPPORT_GPU |
- bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, |
- const SkIRect& bounds) const override; |
+ bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, |
+ const SkMatrix&, const SkIRect& bounds, GrRenderTarget* dst) const override; |
#endif |
private: |
@@ -68,8 +68,9 @@ public: |
static GrFragmentProcessor* Create(GrTexture* texture, |
GrTexture* maskTexture, |
float innerThreshold, |
- float outerThreshold) { |
- return new AlphaThresholdEffect(texture, maskTexture, innerThreshold, outerThreshold); |
+ float outerThreshold, GrRenderTarget* dst) { |
+ return new AlphaThresholdEffect(texture, maskTexture, innerThreshold, |
+ outerThreshold, dst); |
} |
virtual ~AlphaThresholdEffect() {}; |
@@ -83,17 +84,18 @@ private: |
AlphaThresholdEffect(GrTexture* texture, |
GrTexture* maskTexture, |
float innerThreshold, |
- float outerThreshold) |
+ float outerThreshold, |
+ GrRenderTarget* dst) |
: fInnerThreshold(innerThreshold) |
, fOuterThreshold(outerThreshold) |
, fImageCoordTransform(kLocal_GrCoordSet, |
GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture, |
GrTextureParams::kNone_FilterMode) |
- , fImageTextureAccess(texture) |
+ , fImageTextureAccess(texture, GrTextureParams::kNone_FilterMode,SkShader::kClamp_TileMode, dst) |
, fMaskCoordTransform(kLocal_GrCoordSet, |
GrCoordTransform::MakeDivByTextureWHMatrix(maskTexture), maskTexture, |
GrTextureParams::kNone_FilterMode) |
- , fMaskTextureAccess(maskTexture) { |
+ , fMaskTextureAccess(maskTexture, GrTextureParams::kNone_FilterMode,SkShader::kClamp_TileMode, dst) { |
this->initClassID<AlphaThresholdEffect>(); |
this->addCoordTransform(&fImageCoordTransform); |
this->addTextureAccess(&fImageTextureAccess); |
@@ -198,7 +200,8 @@ const GrFragmentProcessor* AlphaThresholdEffect::TestCreate(GrProcessorTestData* |
GrTexture* maskTex = d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx]; |
float innerThresh = d->fRandom->nextUScalar1(); |
float outerThresh = d->fRandom->nextUScalar1(); |
- return AlphaThresholdEffect::Create(bmpTex, maskTex, innerThresh, outerThresh); |
+ return AlphaThresholdEffect::Create(bmpTex, maskTex, innerThresh, |
+ outerThresh, NULL); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -253,7 +256,7 @@ SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(const SkRegion& region, |
bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp, |
GrTexture* texture, |
const SkMatrix& inMatrix, |
- const SkIRect&) const { |
+ const SkIRect&, GrRenderTarget* dst) const { |
if (fp) { |
GrContext* context = texture->getContext(); |
GrSurfaceDesc maskDesc; |
@@ -288,10 +291,12 @@ bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp, |
} |
} |
+ // TODO: whoever uses the resulting 'fp' needs to "use" the correct |
+ // drawContext |
*fp = AlphaThresholdEffect::Create(texture, |
maskTexture, |
fInnerThreshold, |
- fOuterThreshold); |
+ fOuterThreshold, dst); |
} |
return true; |
} |