diff options
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.cpp | 13 | ||||
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.h | 2 | ||||
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.cpp | 6 | ||||
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.h | 2 | ||||
-rw-r--r-- | src/effects/SkArithmeticImageFilter.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkBlurMaskFilter.cpp | 13 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 12 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkLumaColorFilter.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkMagnifierImageFilter.cpp | 7 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 9 | ||||
-rw-r--r-- | src/effects/SkOverdrawColorFilter.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkRRectsGaussianEdgeMaskFilter.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 33 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 9 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp | 1 |
18 files changed, 3 insertions, 137 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp index 45a7b65cb4..f0338a6053 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp @@ -9,9 +9,7 @@ #if SK_SUPPORT_GPU -#include "GrInvariantOutput.h" #include "SkRefCnt.h" - #include "glsl/GrGLSLColorSpaceXformHelper.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" @@ -71,17 +69,6 @@ bool GrAlphaThresholdFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBa this->fOuterThreshold == s.fOuterThreshold); } -void GrAlphaThresholdFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { - GrPixelConfig config = this->textureSampler(0).texture()->config(); - if (GrPixelConfigIsAlphaOnly(config)) { - inout->mulByUnknownSingleComponent(); - } else if (GrPixelConfigIsOpaque(config) && fOuterThreshold >= 1.f) { - inout->mulByUnknownOpaqueFourComponents(); - } else { - inout->mulByUnknownFourComponents(); - } -} - /////////////////////////////////////////////////////////////////////////////// class GrGLAlphaThresholdFragmentProcessor : public GrGLSLFragmentProcessor { diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.h b/src/effects/GrAlphaThresholdFragmentProcessor.h index f2c14c64bc..fe97c7d96c 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.h +++ b/src/effects/GrAlphaThresholdFragmentProcessor.h @@ -50,8 +50,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; float fInnerThreshold; diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index c54a71c809..70c4247b1e 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -10,9 +10,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrInvariantOutput.h" #include "GrTextureProvider.h" - #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -107,10 +105,6 @@ void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& ca return; } -void GrCircleBlurFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - // Computes an unnormalized half kernel (right side). Returns the summation of all the half kernel // values. static float make_unnormalized_half_kernel(float* halfKernel, int halfKernelSize, float sigma) { diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h index 4e7ed13020..f577cc7e42 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.h +++ b/src/effects/GrCircleBlurFragmentProcessor.h @@ -59,8 +59,6 @@ private: fTextureRadius == cbfp.fTextureRadius; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkRect fCircle; SkScalar fSolidRadius; float fTextureRadius; diff --git a/src/effects/SkArithmeticImageFilter.cpp b/src/effects/SkArithmeticImageFilter.cpp index 40560690ee..af834aafb5 100644 --- a/src/effects/SkArithmeticImageFilter.cpp +++ b/src/effects/SkArithmeticImageFilter.cpp @@ -285,11 +285,6 @@ private: fEnforcePMColor == fp.fEnforcePMColor; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // TODO: optimize this - inout->setToUnknown(); - } - // This could implement the const input -> const output optimization but it's unlikely to help. ArithmeticFP(float k1, float k2, float k3, float k4, bool enforcePMColor, sk_sp<GrFragmentProcessor> dst) diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index f41648dc4b..c070ccf87c 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -21,7 +21,6 @@ #include "GrRenderTargetContext.h" #include "GrTexture.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrShaderCaps.h" #include "GrStyle.h" #include "GrTextureProxy.h" @@ -823,8 +822,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - static GrTexture* CreateBlurProfileTexture(GrTextureProvider*, float sigma); SkRect fRect; @@ -999,10 +996,6 @@ bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const { return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); } -void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); #if GR_TEST_UTILS @@ -1093,8 +1086,6 @@ private: bool onIsEqual(const GrFragmentProcessor& other) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkRRect fRRect; float fSigma; TextureSampler fNinePatchSampler; @@ -1205,10 +1196,6 @@ sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrContext* context, mask.get())); } -void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTexture* ninePatchTexture) : INHERITED(kModulatesInput_OptimizationFlag) , fRRect(rrect) diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 67fb761ed4..6b9cb2b4ed 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -16,7 +16,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrCoordTransform.h" -#include "GrInvariantOutput.h" #include "GrRenderTargetContext.h" #include "GrTextureProxy.h" @@ -250,8 +249,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GrDisplacementMapEffect(SkDisplacementMapEffect::ChannelSelectorType xChannelSelector, SkDisplacementMapEffect::ChannelSelectorType yChannelSelector, const SkVector& scale, @@ -524,15 +521,6 @@ bool GrDisplacementMapEffect::onIsEqual(const GrFragmentProcessor& sBase) const fScale == s.fScale; } -void GrDisplacementMapEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - // Any displacement offset bringing a pixel out of bounds will output a color of (0,0,0,0), - // so the only way we'd get a constant alpha is if the input color image has a constant alpha - // and no displacement offset push any texture coordinates out of bounds OR if the constant - // alpha is 0. Since this isn't trivial to compute at this point, let's assume the output is - // not of constant color when a displacement effect is applied. - inout->setToUnknown(); -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect); diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index fc7b29b490..51087249b3 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -18,7 +18,6 @@ #include "GrContext.h" #include "GrFixedClip.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrPaint.h" #include "GrRenderTargetContext.h" #include "GrTextureProxy.h" @@ -558,10 +557,6 @@ public: protected: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // lighting shaders are complicated. We just throw up our hands. - inout->mulByUnknownFourComponents(); - } private: const SkImageFilterLight* fLight; diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp index 1792437e34..2809c8b492 100644 --- a/src/effects/SkLumaColorFilter.cpp +++ b/src/effects/SkLumaColorFilter.cpp @@ -13,7 +13,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrInvariantOutput.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #endif @@ -113,10 +112,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override { return true; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // The output is always black. The alpha value for the color passed in is arbitrary. - inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0)); - } GrColor4f constantOutputForConstantInput(GrColor4f input) const override { float luma = SK_ITU_BT709_LUM_COEFF_R * input.fRGBA[0] + SK_ITU_BT709_LUM_COEFF_G * input.fRGBA[1] + diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 93a67104f4..d62ce9c320 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -17,7 +17,6 @@ //////////////////////////////////////////////////////////////////////////////// #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrInvariantOutput.h" #include "effects/GrSingleTextureEffect.h" #include "glsl/GrGLSLColorSpaceXformHelper.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -88,8 +87,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; SkRect fBounds; @@ -251,10 +248,6 @@ bool GrMagnifierEffect::onIsEqual(const GrFragmentProcessor& sBase) const { this->fYInvInset == s.fYInvInset); } -void GrMagnifierEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - this->updateInvariantOutputForModulation(inout); -} - #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 2c813e283a..bf92b4f3fd 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -18,7 +18,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrFixedClip.h" -#include "GrInvariantOutput.h" #include "GrRenderTargetContext.h" #include "GrTexture.h" #include "GrTextureProxy.h" @@ -177,8 +176,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType, const float bounds[2]); @@ -363,12 +360,6 @@ bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { this->type() == s.type()); } -void GrMorphologyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - // This is valid because the color components of the result of the kernel all come - // exactly from existing values in the source texture. - this->updateInvariantOutputForModulation(inout); -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect); diff --git a/src/effects/SkOverdrawColorFilter.cpp b/src/effects/SkOverdrawColorFilter.cpp index 243ef77cd0..7c5212d0ec 100644 --- a/src/effects/SkOverdrawColorFilter.cpp +++ b/src/effects/SkOverdrawColorFilter.cpp @@ -50,7 +50,6 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END #if SK_SUPPORT_GPU #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" @@ -63,7 +62,6 @@ private: GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {} bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; OverdrawFragmentProcessor(const GrColor4f* colors); @@ -122,10 +120,6 @@ bool OverdrawFragmentProcessor::onIsEqual(const GrFragmentProcessor& other) cons sizeof(GrColor4f) * SkOverdrawColorFilter::kNumColors); } -void OverdrawFragmentProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->invalidateComponents(kRGBA_GrColorComponentFlags); -} - GLOverdrawFragmentProcessor::GLOverdrawFragmentProcessor(const GrColor4f* colors) { memcpy(fColors, colors, SkOverdrawColorFilter::kNumColors * sizeof(GrColor4f)); } diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 7582196573..668ca6c678 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -18,7 +18,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrCoordTransform.h" -#include "GrInvariantOutput.h" #include "SkGr.h" #include "effects/GrConstColorProcessor.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -532,10 +531,6 @@ private: fPaintingData->fStitchDataInit == s.fPaintingData->fStitchDataInit; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - inout->setToUnknown(); - } - GrPerlinNoiseEffect(SkPerlinNoiseShader::Type type, int numOctaves, bool stitchTiles, SkPerlinNoiseShader::PaintingData* paintingData, GrTexture* permutationsTexture, GrTexture* noiseTexture, diff --git a/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp b/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp index 223887bab9..7635759ca2 100644 --- a/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp +++ b/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp @@ -190,7 +190,6 @@ bool SkRRectsGaussianEdgeMaskFilterImpl::filterMask(SkMask* dst, const SkMask& s #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -453,10 +452,6 @@ public: const char* name() const override { return "RRectsGaussianEdgeFP"; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - inout->setToUnknown(); - } - const SkRRect& first() const { return fFirst; } Mode firstMode() const { return fFirstMode; } const SkRRect& second() const { return fSecond; } diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index 7de1008abe..8960449eb1 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -361,7 +361,6 @@ sk_sp<SkColorFilter> SkTable_ColorFilter::makeComposed(sk_sp<SkColorFilter> inne #include "GrContext.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrTextureStripAtlas.h" #include "SkGr.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -387,19 +386,13 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row, unsigned flags); GR_DECLARE_FRAGMENT_PROCESSOR_TEST; - TextureSampler fTextureSampler; - - // currently not used in shader code, just to assist onComputeInvariantOutput(). - unsigned fFlags; - - GrTextureStripAtlas* fAtlas; - int fRow; + TextureSampler fTextureSampler; + GrTextureStripAtlas* fAtlas; + int fRow; typedef GrFragmentProcessor INHERITED; }; @@ -514,7 +507,6 @@ ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atla unsigned flags) : INHERITED(kNone_OptimizationFlags) // Not bothering with table-specific optimizations. , fTextureSampler(texture) - , fFlags(flags) , fAtlas(atlas) , fRow(row) { this->initClassID<ColorTableEffect>(); @@ -546,25 +538,6 @@ bool ColorTableEffect::onIsEqual(const GrFragmentProcessor& other) const { return fRow == that.fRow; } -void ColorTableEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - // If we kept the table in the effect then we could actually run known inputs through the - // table. - GrColorComponentFlags invalidateFlags = kNone_GrColorComponentFlags; - if (fFlags & SkTable_ColorFilter::kR_Flag) { - invalidateFlags |= kR_GrColorComponentFlag; - } - if (fFlags & SkTable_ColorFilter::kG_Flag) { - invalidateFlags |= kG_GrColorComponentFlag; - } - if (fFlags & SkTable_ColorFilter::kB_Flag) { - invalidateFlags |= kB_GrColorComponentFlag; - } - if (fFlags & SkTable_ColorFilter::kA_Flag) { - invalidateFlags |= kA_GrColorComponentFlag; - } - inout->invalidateComponents(invalidateFlags); -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect); diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 9b38cb5b83..03f0cbc238 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -1121,7 +1121,6 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrInvariantOutput.h" #include "GrShaderCaps.h" #include "GrTextureStripAtlas.h" #include "gl/GrGLContext.h" @@ -1744,14 +1743,6 @@ bool GrGradientEffect::onIsEqual(const GrFragmentProcessor& processor) const { return GrColorSpaceXform::Equals(this->fColorSpaceXform.get(), ge.fColorSpaceXform.get()); } -void GrGradientEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - if (fIsOpaque) { - inout->mulByUnknownOpaqueFourComponents(); - } else { - inout->mulByUnknownFourComponents(); - } -} - #if GR_TEST_UTILS GrGradientEffect::RandomGradientParams::RandomGradientParams(SkRandom* random) { // Set color count to min of 2 so that we don't trigger the const color optimization and make diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index fe238ff18c..1e3415371e 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -427,8 +427,6 @@ protected: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - const GrCoordTransform& getCoordTransform() const { return fCoordTransform; } private: diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp index a301d64aca..bf92299e26 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp @@ -10,7 +10,6 @@ #if SK_SUPPORT_GPU #include "GrCoordTransform.h" -#include "GrInvariantOutput.h" #include "GrPaint.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" |