Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: src/gpu/effects/GrGammaEffect.h

Issue 1964943003: Revert of Make GrGammaEffect have explicit sRGB modes, plus exponential mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrGammaEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrGammaEffect.h
diff --git a/src/gpu/effects/GrGammaEffect.h b/src/gpu/effects/GrGammaEffect.h
index 2e53b09278613799deea19ef7cf09c10f8d4b775..44d6d6707cb1f14a862764b59845b00b416e7200 100644
--- a/src/gpu/effects/GrGammaEffect.h
+++ b/src/gpu/effects/GrGammaEffect.h
@@ -8,40 +8,35 @@
#ifndef GrGammaEffect_DEFINED
#define GrGammaEffect_DEFINED
-#include "GrFragmentProcessor.h"
+#include "GrSingleTextureEffect.h"
-class GrGammaEffect : public GrFragmentProcessor {
+class GrGammaEffect : public GrSingleTextureEffect {
public:
- enum class Mode {
- kLinearToSRGB,
- kSRGBToLinear,
- kExponential,
- };
-
/**
- * Creates an effect that applies a gamma curve.
- */
- static const GrFragmentProcessor* Create(SkScalar gamma);
+ * 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);
const char* name() const override { return "Gamma"; }
- Mode mode() const { return fMode; }
+ bool gammaIsSRGB() const { return fGammaIsSRGB; }
SkScalar gamma() const { return fGamma; }
private:
- GrGammaEffect(Mode mode, SkScalar gamma);
+ GrGammaEffect(GrTexture*, 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;
- Mode fMode;
+ bool fGammaIsSRGB;
SkScalar fGamma;
GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
- typedef GrFragmentProcessor INHERITED;
+ typedef GrSingleTextureEffect INHERITED;
};
#endif
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrGammaEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698