| Index: src/gpu/effects/GrGammaEffect.h
|
| diff --git a/src/gpu/effects/GrGammaEffect.h b/src/gpu/effects/GrGammaEffect.h
|
| index 44d6d6707cb1f14a862764b59845b00b416e7200..2e53b09278613799deea19ef7cf09c10f8d4b775 100644
|
| --- a/src/gpu/effects/GrGammaEffect.h
|
| +++ b/src/gpu/effects/GrGammaEffect.h
|
| @@ -8,35 +8,40 @@
|
| #ifndef GrGammaEffect_DEFINED
|
| #define GrGammaEffect_DEFINED
|
|
|
| -#include "GrSingleTextureEffect.h"
|
| +#include "GrFragmentProcessor.h"
|
|
|
| -class GrGammaEffect : public GrSingleTextureEffect {
|
| +class GrGammaEffect : public GrFragmentProcessor {
|
| public:
|
| + enum class Mode {
|
| + kLinearToSRGB,
|
| + kSRGBToLinear,
|
| + kExponential,
|
| + };
|
| +
|
| /**
|
| - * Creates an effect that applies a gamma curve. The source texture is always
|
| - * sampled unfiltered and with clamping.
|
| - */
|
| - static const GrFragmentProcessor* Create(GrTexture*, SkScalar gamma);
|
| + * Creates an effect that applies a gamma curve.
|
| + */
|
| + static const GrFragmentProcessor* Create(SkScalar gamma);
|
|
|
| const char* name() const override { return "Gamma"; }
|
|
|
| - bool gammaIsSRGB() const { return fGammaIsSRGB; }
|
| + Mode mode() const { return fMode; }
|
| SkScalar gamma() const { return fGamma; }
|
|
|
| private:
|
| - GrGammaEffect(GrTexture*, SkScalar gamma);
|
| + GrGammaEffect(Mode mode, SkScalar gamma);
|
|
|
| GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
|
| void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
|
| bool onIsEqual(const GrFragmentProcessor&) const override;
|
| void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
|
|
|
| - bool fGammaIsSRGB;
|
| + Mode fMode;
|
| SkScalar fGamma;
|
|
|
| GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
|
|
|
| - typedef GrSingleTextureEffect INHERITED;
|
| + typedef GrFragmentProcessor INHERITED;
|
| };
|
|
|
| #endif
|
|
|