Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: src/effects/SkAlphaThresholdFilter.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/GrCircleBlurFragmentProcessor.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/effects/GrCircleBlurFragmentProcessor.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698