Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2016 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef GrGammaEffect_DEFINED | |
| 9 #define GrGammaEffect_DEFINED | |
| 10 | |
| 11 #include "GrSingleTextureEffect.h" | |
| 12 | |
| 13 class GrGammaEffect : public GrSingleTextureEffect { | |
| 14 public: | |
| 15 /** | |
| 16 * Creates an effect that applies a gamma curve. | |
|
bsalomon
2016/04/29 18:27:20
Doc how src is sampled (always nearest)?
Brian Osman
2016/05/02 21:02:45
Done.
| |
| 17 */ | |
| 18 static const GrFragmentProcessor* Create(GrTexture*, SkScalar gamma); | |
| 19 | |
| 20 const char* name() const override { return "Gamma"; } | |
| 21 | |
| 22 bool gammaIsSRGB() const { return fGammaIsSRGB; } | |
| 23 SkScalar gamma() const { return fGamma; } | |
| 24 | |
| 25 private: | |
| 26 GrGammaEffect(GrTexture*, SkScalar gamma); | |
| 27 | |
| 28 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; | |
| 29 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; | |
| 30 bool onIsEqual(const GrFragmentProcessor&) const override; | |
| 31 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | |
| 32 | |
| 33 bool fGammaIsSRGB; | |
| 34 SkScalar fGamma; | |
| 35 | |
| 36 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | |
| 37 | |
| 38 typedef GrSingleTextureEffect INHERITED; | |
| 39 }; | |
| 40 | |
| 41 #endif | |
| OLD | NEW |