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

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

Issue 1919993002: Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel buffer on Windows. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Plumb gamma to shader, fix window title Created 4 years, 8 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
Index: src/gpu/effects/GrColorSpaceEffect.h
diff --git a/src/gpu/effects/GrColorSpaceEffect.h b/src/gpu/effects/GrColorSpaceEffect.h
new file mode 100644
index 0000000000000000000000000000000000000000..f0bfbd906785c0e0b6e2fec254ceb5568b1af688
--- /dev/null
+++ b/src/gpu/effects/GrColorSpaceEffect.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrColorSpaceEffect_DEFINED
+#define GrColorSpaceEffect_DEFINED
+
+#include "GrSingleTextureEffect.h"
+
+#include "SkColorSpace.h"
+
+class GrColorSpaceEffect : public GrSingleTextureEffect {
+public:
+ /**
+ * Creates an effect that performs linear -> sRGB conversion.
+ */
+ static const GrFragmentProcessor* Create(GrTexture*,
+ const SkColorSpace* srcColorSpace,
+ const SkColorSpace* dstColorSpace,
+ uint32_t colorSpaceOpsFlags);
+
+ const char* name() const override { return "Color Space"; }
+
+ bool manualDstGamma() const { return fManualDstGamma; }
+ bool gammaIsSRGB() const { return fGammaIsSRGB; }
+ const SkFloat3& gamma() const { return fGamma; }
+
+private:
+ GrColorSpaceEffect(GrTexture*, const SkColorSpace* srcColorSpace,
+ const SkColorSpace* dstColorSpace, uint32_t colorSpaceOpsFlags);
+
+ GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+
+ void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
+
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
+
+ bool fManualDstGamma;
+ bool fGammaIsSRGB;
+ SkFloat3 fGamma;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+
+ typedef GrSingleTextureEffect INHERITED;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698