aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/imagefilters
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/imagefilters')
-rw-r--r--src/effects/imagefilters/SkDisplacementMapEffect.cpp10
-rw-r--r--src/effects/imagefilters/SkLightingImageFilter.cpp6
-rw-r--r--src/effects/imagefilters/SkMorphologyImageFilter.cpp6
3 files changed, 14 insertions, 8 deletions
diff --git a/src/effects/imagefilters/SkDisplacementMapEffect.cpp b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
index 026c03ea07..2ab8c5e051 100644
--- a/src/effects/imagefilters/SkDisplacementMapEffect.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
@@ -208,6 +208,10 @@ private:
sk_sp<GrTextureProxy> displacement, const SkMatrix& offsetMatrix,
sk_sp<GrTextureProxy> color, const SkISize& colorDimensions);
+ const TextureSampler& onTextureSampler(int i) const override {
+ return IthTextureSampler(i, fDisplacementSampler, fColorSampler);
+ }
+
GR_DECLARE_FRAGMENT_PROCESSOR_TEST
GrCoordTransform fDisplacementTransform;
@@ -461,9 +465,8 @@ GrDisplacementMapEffect::GrDisplacementMapEffect(
, fYChannelSelector(yChannelSelector)
, fScale(scale) {
this->addCoordTransform(&fDisplacementTransform);
- this->addTextureSampler(&fDisplacementSampler);
this->addCoordTransform(&fColorTransform);
- this->addTextureSampler(&fColorSampler);
+ this->setTextureSamplerCnt(2);
}
GrDisplacementMapEffect::GrDisplacementMapEffect(const GrDisplacementMapEffect& that)
@@ -478,9 +481,8 @@ GrDisplacementMapEffect::GrDisplacementMapEffect(const GrDisplacementMapEffect&
, fYChannelSelector(that.fYChannelSelector)
, fScale(that.fScale) {
this->addCoordTransform(&fDisplacementTransform);
- this->addTextureSampler(&fDisplacementSampler);
this->addCoordTransform(&fColorTransform);
- this->addTextureSampler(&fColorSampler);
+ this->setTextureSamplerCnt(2);
}
GrDisplacementMapEffect::~GrDisplacementMapEffect() {}
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index 9a560b4ceb..486a3efd65 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -613,6 +613,8 @@ protected:
bool onIsEqual(const GrFragmentProcessor&) const override;
private:
+ const TextureSampler& onTextureSampler(int) const override { return fTextureSampler; }
+
GrCoordTransform fCoordTransform;
GrTextureDomain fDomain;
TextureSampler fTextureSampler;
@@ -1696,7 +1698,7 @@ GrLightingEffect::GrLightingEffect(ClassID classID,
, fFilterMatrix(matrix)
, fBoundaryMode(boundaryMode) {
this->addCoordTransform(&fCoordTransform);
- this->addTextureSampler(&fTextureSampler);
+ this->setTextureSamplerCnt(1);
}
GrLightingEffect::GrLightingEffect(const GrLightingEffect& that)
@@ -1709,7 +1711,7 @@ GrLightingEffect::GrLightingEffect(const GrLightingEffect& that)
, fFilterMatrix(that.fFilterMatrix)
, fBoundaryMode(that.fBoundaryMode) {
this->addCoordTransform(&fCoordTransform);
- this->addTextureSampler(&fTextureSampler);
+ this->setTextureSamplerCnt(1);
}
bool GrLightingEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/effects/imagefilters/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
index 899c5a1d57..99060b9453 100644
--- a/src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -167,6 +167,8 @@ private:
bool onIsEqual(const GrFragmentProcessor&) const override;
+ const TextureSampler& onTextureSampler(int i) const override { return fTextureSampler; }
+
GrMorphologyEffect(sk_sp<GrTextureProxy>, Direction, int radius, Type, const float range[2]);
explicit GrMorphologyEffect(const GrMorphologyEffect&);
@@ -317,7 +319,7 @@ GrMorphologyEffect::GrMorphologyEffect(sk_sp<GrTextureProxy> proxy,
, fType(type)
, fUseRange(SkToBool(range)) {
this->addCoordTransform(&fCoordTransform);
- this->addTextureSampler(&fTextureSampler);
+ this->setTextureSamplerCnt(1);
if (fUseRange) {
fRange[0] = range[0];
fRange[1] = range[1];
@@ -333,7 +335,7 @@ GrMorphologyEffect::GrMorphologyEffect(const GrMorphologyEffect& that)
, fType(that.fType)
, fUseRange(that.fUseRange) {
this->addCoordTransform(&fCoordTransform);
- this->addTextureSampler(&fTextureSampler);
+ this->setTextureSamplerCnt(1);
if (that.fUseRange) {
fRange[0] = that.fRange[0];
fRange[1] = that.fRange[1];