diff options
Diffstat (limited to 'src/gpu/effects')
26 files changed, 1 insertions, 208 deletions
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h index 824883c9e6..f90855195d 100644 --- a/src/gpu/effects/GrBezierEffect.h +++ b/src/gpu/effects/GrBezierEffect.h @@ -11,7 +11,6 @@ #include "GrCaps.h" #include "GrProcessor.h" #include "GrGeometryProcessor.h" -#include "GrInvariantOutput.h" #include "GrTypesPriv.h" /** diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp index 2499c20cb2..5f06fc166a 100644 --- a/src/gpu/effects/GrBicubicEffect.cpp +++ b/src/gpu/effects/GrBicubicEffect.cpp @@ -6,7 +6,6 @@ */ #include "GrBicubicEffect.h" -#include "GrInvariantOutput.h" #include "GrProxyMove.h" #include "GrTextureProxy.h" #include "glsl/GrGLSLColorSpaceXformHelper.h" @@ -196,11 +195,6 @@ bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { return fDomain == s.fDomain; } -void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - // FIXME: Perhaps we can do better. - inout->mulByUnknownSingleComponent(); -} - GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); #if GR_TEST_UTILS diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h index a51aad8cab..ba80ec2fc4 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -99,8 +99,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GrTextureDomain fDomain; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index 60df6b90b2..cb9cfdcc84 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -6,7 +6,6 @@ */ #include "GrBitmapTextGeoProc.h" -#include "GrInvariantOutput.h" #include "GrTexture.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLGeometryProcessor.h" diff --git a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp index a4db68df05..2d49883066 100644 --- a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp +++ b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp @@ -6,7 +6,6 @@ */ #include "effects/GrBlurredEdgeFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" @@ -68,8 +67,4 @@ bool GrBlurredEdgeFP::onIsEqual(const GrFragmentProcessor& other) const { return that.fMode == fMode; } -void GrBlurredEdgeFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownFourComponents(); -} - diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 771eba80f7..ba089fab2e 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -8,7 +8,6 @@ #include "GrConfigConversionEffect.h" #include "GrContext.h" #include "GrRenderTargetContext.h" -#include "GrInvariantOutput.h" #include "GrSimpleTextureEffect.h" #include "SkMatrix.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -136,10 +135,6 @@ bool GrConfigConversionEffect::onIsEqual(const GrFragmentProcessor& s) const { other.fPMConversion == fPMConversion; } -void GrConfigConversionEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - this->updateInvariantOutputForModulation(inout); -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h index 151365b9b0..afa24c017c 100644 --- a/src/gpu/effects/GrConfigConversionEffect.h +++ b/src/gpu/effects/GrConfigConversionEffect.h @@ -64,8 +64,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GrSwizzle fSwizzle; PMConversion fPMConversion; diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp index 1d20512a63..1013ff318a 100644 --- a/src/gpu/effects/GrConstColorProcessor.cpp +++ b/src/gpu/effects/GrConstColorProcessor.cpp @@ -6,7 +6,6 @@ */ #include "effects/GrConstColorProcessor.h" -#include "GrInvariantOutput.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -62,29 +61,6 @@ private: /////////////////////////////////////////////////////////////////////////////// -void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) const { - if (kIgnore_InputMode == fMode) { - inout->setToOther(kRGBA_GrColorComponentFlags, fColor.toGrColor()); - } else { - float r = fColor.fRGBA[0]; - bool colorIsSingleChannel = r == fColor.fRGBA[1] && r == fColor.fRGBA[2] && - r == fColor.fRGBA[3]; - if (kModulateRGBA_InputMode == fMode) { - if (colorIsSingleChannel) { - inout->mulByKnownSingleComponent(SkToU8(sk_float_round2int(255.0f * r))); - } else { - inout->mulByKnownFourComponents(fColor.toGrColor()); - } - } else { - if (colorIsSingleChannel) { - inout->mulAlphaByKnownSingleComponent(SkToU8(sk_float_round2int(255.0f * r))); - } else { - inout->mulAlphaByKnownFourComponents(fColor.toGrColor()); - } - } - } -} - GrColor4f GrConstColorProcessor::constantOutputForConstantInput(GrColor4f input) const { switch (fMode) { case kIgnore_InputMode: diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index db8c2d999e..907a9e5112 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -6,7 +6,6 @@ */ #include "GrConvexPolyEffect.h" -#include "GrInvariantOutput.h" #include "SkPathPriv.h" #include "effects/GrConstColorProcessor.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -43,15 +42,6 @@ private: return fRect == aare.fRect; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - if (fRect.isEmpty()) { - // An empty rect will have no coverage anywhere. - inout->mulByKnownSingleComponent(0); - } else { - inout->mulByUnknownSingleComponent(); - } - } - SkRect fRect; GrPrimitiveEdgeType fEdgeType; @@ -327,10 +317,6 @@ sk_sp<GrFragmentProcessor> GrConvexPolyEffect::Make(GrPrimitiveEdgeType edgeType GrConvexPolyEffect::~GrConvexPolyEffect() {} -void GrConvexPolyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - void GrConvexPolyEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const { GrGLConvexPolyEffect::GenKey(*this, caps, b); diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h index 2d9d20fc7f..b5ae724d3f 100644 --- a/src/gpu/effects/GrConvexPolyEffect.h +++ b/src/gpu/effects/GrConvexPolyEffect.h @@ -78,8 +78,6 @@ private: bool onIsEqual(const GrFragmentProcessor& other) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GrPrimitiveEdgeType fEdgeType; int fEdgeCount; SkScalar fEdges[3 * kMaxEdges]; diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp index e40d184577..4a4cb60b4e 100644 --- a/src/gpu/effects/GrCustomXfermode.cpp +++ b/src/gpu/effects/GrCustomXfermode.cpp @@ -10,7 +10,6 @@ #include "GrCoordTransform.h" #include "GrContext.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrPipeline.h" #include "GrProcessor.h" #include "GrShaderCaps.h" diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index 0f9625e8a0..9a7e787577 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -6,11 +6,8 @@ */ #include "GrDistanceFieldGeoProc.h" -#include "GrInvariantOutput.h" #include "GrTexture.h" - #include "SkDistanceFieldGen.h" - #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLGeometryProcessor.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp index 34a15651d2..036d42c4cf 100644 --- a/src/gpu/effects/GrDitherEffect.cpp +++ b/src/gpu/effects/GrDitherEffect.cpp @@ -7,7 +7,6 @@ #include "GrDitherEffect.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "SkRect.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" @@ -35,17 +34,11 @@ private: // All dither effects are equal bool onIsEqual(const GrFragmentProcessor&) const override { return true; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; typedef GrFragmentProcessor INHERITED; }; -void DitherEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->setToUnknown(); -} - ////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect); diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h index 0bb9c5e1df..6d6e5b0ebd 100644 --- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h +++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h @@ -9,7 +9,6 @@ #define GrGaussianConvolutionFragmentProcessor_DEFINED #include "Gr1DKernelEffect.h" -#include "GrInvariantOutput.h" /** * A 1D Gaussian convolution effect. The kernel is computed as an array of 2 * half-width weights. @@ -73,12 +72,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // If the texture was opaque we could know that the output color if we knew the sum of the - // kernel values. - inout->mulByUnknownFourComponents(); - } - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; // TODO: Inline the kernel constants into the generated shader code. This may involve pulling diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h index 0bb7c5043a..581323b3cc 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.h +++ b/src/gpu/effects/GrMatrixConvolutionEffect.h @@ -9,7 +9,6 @@ #define GrMatrixConvolutionEffect_DEFINED #include "GrSingleTextureEffect.h" -#include "GrInvariantOutput.h" #include "GrTextureDomain.h" // A little bit less than the minimum # uniforms required by DX9SM2 (32). @@ -109,11 +108,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // TODO: Try to do better? - inout->mulByUnknownFourComponents(); - } - SkIRect fBounds; SkISize fKernelSize; float fKernel[MAX_KERNEL_SIZE]; diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp index b64ac56859..36db836653 100644 --- a/src/gpu/effects/GrOvalEffect.cpp +++ b/src/gpu/effects/GrOvalEffect.cpp @@ -8,7 +8,6 @@ #include "GrOvalEffect.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "SkRect.h" #include "GrShaderCaps.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -42,8 +41,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkPoint fCenter; SkScalar fRadius; GrPrimitiveEdgeType fEdgeType; @@ -59,10 +56,6 @@ sk_sp<GrFragmentProcessor> CircleEffect::Make(GrPrimitiveEdgeType edgeType, cons return sk_sp<GrFragmentProcessor>(new CircleEffect(edgeType, center, radius)); } -void CircleEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - CircleEffect::CircleEffect(GrPrimitiveEdgeType edgeType, const SkPoint& c, SkScalar r) : INHERITED(kModulatesInput_OptimizationFlag), fCenter(c), fRadius(r), fEdgeType(edgeType) { this->initClassID<CircleEffect>(); @@ -207,8 +200,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkPoint fCenter; SkVector fRadii; GrPrimitiveEdgeType fEdgeType; @@ -226,10 +217,6 @@ sk_sp<GrFragmentProcessor> EllipseEffect::Make(GrPrimitiveEdgeType edgeType, return sk_sp<GrFragmentProcessor>(new EllipseEffect(edgeType, center, rx, ry)); } -void EllipseEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - EllipseEffect::EllipseEffect(GrPrimitiveEdgeType edgeType, const SkPoint& c, SkScalar rx, SkScalar ry) : INHERITED(kModulatesInput_OptimizationFlag) diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index dabf11ae8d..29d3d3de0d 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -9,7 +9,6 @@ #include "GrConvexPolyEffect.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrOvalEffect.h" #include "GrShaderCaps.h" #include "SkRRect.h" @@ -68,8 +67,6 @@ private: bool onIsEqual(const GrFragmentProcessor& other) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkRRect fRRect; GrPrimitiveEdgeType fEdgeType; uint32_t fCircularCornerFlags; @@ -89,10 +86,6 @@ sk_sp<GrFragmentProcessor> CircularRRectEffect::Make(GrPrimitiveEdgeType edgeTyp new CircularRRectEffect(edgeType, circularCornerFlags, rrect)); } -void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t circularCornerFlags, const SkRRect& rrect) : INHERITED(kModulatesInput_OptimizationFlag) @@ -411,8 +404,6 @@ private: bool onIsEqual(const GrFragmentProcessor& other) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - SkRRect fRRect; GrPrimitiveEdgeType fEdgeType; @@ -429,10 +420,6 @@ EllipticalRRectEffect::Make(GrPrimitiveEdgeType edgeType, const SkRRect& rrect) return sk_sp<GrFragmentProcessor>(new EllipticalRRectEffect(edgeType, rrect)); } -void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->mulByUnknownSingleComponent(); -} - EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const SkRRect& rrect) : INHERITED(kModulatesInput_OptimizationFlag), fRRect(rrect), fEdgeType(edgeType) { this->initClassID<EllipticalRRectEffect>(); diff --git a/src/gpu/effects/GrSRGBEffect.cpp b/src/gpu/effects/GrSRGBEffect.cpp index ad90e70936..39d6403af4 100644 --- a/src/gpu/effects/GrSRGBEffect.cpp +++ b/src/gpu/effects/GrSRGBEffect.cpp @@ -9,7 +9,6 @@ #include "GrContext.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrProcessor.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" @@ -82,10 +81,6 @@ bool GrSRGBEffect::onIsEqual(const GrFragmentProcessor& s) const { return other.fMode == fMode; } -void GrSRGBEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - inout->setToUnknown(); -} - static inline float srgb_to_linear(float srgb) { return (srgb <= 0.04045f) ? srgb / 12.92f : powf((srgb + 0.055f) / 1.055f, 2.4f); } diff --git a/src/gpu/effects/GrSRGBEffect.h b/src/gpu/effects/GrSRGBEffect.h index 3d05dd646b..17afa5e5bd 100644 --- a/src/gpu/effects/GrSRGBEffect.h +++ b/src/gpu/effects/GrSRGBEffect.h @@ -32,7 +32,7 @@ private: GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; + GrColor4f constantOutputForConstantInput(GrColor4f input) const override; Mode fMode; diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp index 8b63fec907..bd4e7206f8 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.cpp +++ b/src/gpu/effects/GrSimpleTextureEffect.cpp @@ -6,7 +6,6 @@ */ #include "GrSimpleTextureEffect.h" -#include "GrInvariantOutput.h" #include "GrProxyMove.h" #include "GrTexture.h" #include "glsl/GrGLSLColorSpaceXformHelper.h" @@ -79,10 +78,6 @@ private: /////////////////////////////////////////////////////////////////////////////// -void GrSimpleTextureEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - this->updateInvariantOutputForModulation(inout); -} - void GrSimpleTextureEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const { GrGLSimpleTextureEffect::GenKey(*this, caps, b); diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index 64ca3cb8f5..e7fe8bd4e9 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -111,8 +111,6 @@ private: bool onIsEqual(const GrFragmentProcessor& other) const override { return true; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; typedef GrSingleTextureEffect INHERITED; diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h index 29105b5cda..894334b751 100644 --- a/src/gpu/effects/GrSingleTextureEffect.h +++ b/src/gpu/effects/GrSingleTextureEffect.h @@ -11,7 +11,6 @@ #include "GrFragmentProcessor.h" #include "GrColorSpaceXform.h" #include "GrCoordTransform.h" -#include "GrInvariantOutput.h" #include "SkMatrix.h" class GrTexture; @@ -55,22 +54,6 @@ protected: sk_sp<GrColorSpaceXform>, const SkMatrix&, const GrSamplerParams&); /** - * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that - * the subclass output color will be a modulation of the input color with a value read from the - * texture. - */ - void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { - GrPixelConfig config = this->textureSampler(0).texture()->config(); - if (GrPixelConfigIsAlphaOnly(config)) { - inout->mulByUnknownSingleComponent(); - } else if (GrPixelConfigIsOpaque(config)) { - inout->mulByUnknownOpaqueFourComponents(); - } else { - inout->mulByUnknownFourComponents(); - } - } - - /** * Can be used as a helper to implement subclass onOptimizationFlags(). It assumes that * the subclass output color will be a modulation of the input color with a value read from the * texture. diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index 58707f5744..142cd1d98b 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -8,7 +8,6 @@ #include "GrTextureDomain.h" #include "GrContext.h" -#include "GrInvariantOutput.h" #include "GrShaderCaps.h" #include "GrSimpleTextureEffect.h" #include "GrSurfaceProxyPriv.h" @@ -359,18 +358,6 @@ bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const { return this->fTextureDomain == s.fTextureDomain; } -void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { - if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { - if (GrPixelConfigIsAlphaOnly(this->textureSampler(0).texture()->config())) { - inout->mulByUnknownSingleComponent(); - } else { - inout->mulByUnknownFourComponents(); - } - } else { - this->updateInvariantOutputForModulation(inout); - } -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); @@ -504,15 +491,6 @@ bool GrDeviceSpaceTextureDecalFragmentProcessor::onIsEqual(const GrFragmentProce dstdfp.fTextureDomain == fTextureDomain; } -void GrDeviceSpaceTextureDecalFragmentProcessor::onComputeInvariantOutput( - GrInvariantOutput* inout) const { - if (GrPixelConfigIsAlphaOnly(this->textureSampler(0).texture()->config())) { - inout->mulByUnknownSingleComponent(); - } else { - inout->mulByUnknownFourComponents(); - } -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDeviceSpaceTextureDecalFragmentProcessor); diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h index fbc20f1947..f00d4608ff 100644 --- a/src/gpu/effects/GrTextureDomain.h +++ b/src/gpu/effects/GrTextureDomain.h @@ -205,8 +205,6 @@ private: bool onIsEqual(const GrFragmentProcessor&) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; - GR_DECLARE_FRAGMENT_PROCESSOR_TEST; typedef GrSingleTextureEffect INHERITED; @@ -248,7 +246,6 @@ private: void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {} bool onIsEqual(const GrFragmentProcessor& fp) const override; - void onComputeInvariantOutput(GrInvariantOutput* inout) const override; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp index 78918ce201..612ebeab69 100644 --- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp +++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp @@ -8,7 +8,6 @@ #include "effects/GrXfermodeFragmentProcessor.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "effects/GrConstColorProcessor.h" #include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLBlend.h" @@ -62,10 +61,6 @@ private: return fMode == cs.fMode; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - inout->setToUnknown(); - } - GrColor4f constantOutputForConstantInput(GrColor4f input) const override { float alpha = input.fRGBA[3]; input = input.opaque(); @@ -216,32 +211,6 @@ private: return fMode == that.cast<ComposeOneFragmentProcessor>().fMode; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - SkXfermode::Coeff skSrcCoeff, skDstCoeff; - if (SkXfermode::ModeAsCoeff(fMode, &skSrcCoeff, &skDstCoeff)) { - GrBlendCoeff srcCoeff = SkXfermodeCoeffToGrBlendCoeff(skSrcCoeff); - GrBlendCoeff dstCoeff = SkXfermodeCoeffToGrBlendCoeff(skDstCoeff); - GrInvariantOutput childOutput(0xFFFFFFFF, kRGBA_GrColorComponentFlags); - this->childProcessor(0).computeInvariantOutput(&childOutput); - GrColor blendColor; - GrColorComponentFlags blendFlags; - if (kDst_Child == fChild) { - GrGetCoeffBlendKnownComponents(srcCoeff, dstCoeff, - inout->color(), inout->validFlags(), - childOutput.color(), childOutput.validFlags(), - &blendColor, &blendFlags); - } else { - GrGetCoeffBlendKnownComponents(srcCoeff, dstCoeff, - childOutput.color(), childOutput.validFlags(), - inout->color(), inout->validFlags(), - &blendColor, &blendFlags); - } - inout->setToOther(blendFlags, blendColor); - } else { - inout->setToUnknown(); - } - } - GrColor4f constantOutputForConstantInput(GrColor4f inputColor) const override { GrColor4f childColor = ConstantOutputForConstantInput(this->childProcessor(0), GrColor4f::OpaqueWhite()); diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp index 6d917f36d5..e09e185b55 100644 --- a/src/gpu/effects/GrYUVEffect.cpp +++ b/src/gpu/effects/GrYUVEffect.cpp @@ -10,7 +10,6 @@ #include "GrContext.h" #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" -#include "GrInvariantOutput.h" #include "GrProcessor.h" #include "GrTextureProxy.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -191,11 +190,6 @@ private: return (fColorSpace == s.getColorSpace()) && (fNV12 == s.isNV12()); } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // YUV is opaque - inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A); - } - GrCoordTransform fYTransform; TextureSampler fYSampler; GrCoordTransform fUTransform; @@ -354,10 +348,6 @@ private: return fColorSpace == s.getColorSpace() && fOutputChannels == s.outputChannels(); } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - inout->setToUnknown(); - } - GrCoordTransform fTransform; TextureSampler fTextureSampler; SkYUVColorSpace fColorSpace; |