aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-09-20 09:53:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-20 14:28:03 +0000
commit9a725dd9485654155e2e4196c32d372360bcdb61 (patch)
tree7b2b226fdffc212cce21de7d7804308dc7abbf92 /include/private
parent906126eedc792f12935145a9a2f13eea1d1cd86d (diff)
Use shader based blending to clamp kPlus mode w/F16
Bug: skia:6173 Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908 Reviewed-on: https://skia-review.googlesource.com/48183 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/private')
-rw-r--r--include/private/GrTypesPriv.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index cfa5bbc972..7ad67dfc53 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -89,6 +89,20 @@ enum class GrAllowMixedSamples { kNo, kYes };
GrAAType GrChooseAAType(GrAA, GrFSAAType, GrAllowMixedSamples, const GrCaps&);
/**
+ * Some pixel configs are inherently clamped to [0,1], while others can hold values outside of that
+ * range. This is important for blending - the latter category may require manual clamping.
+ */
+enum class GrPixelConfigIsClamped : bool {
+ kNo, // F16 or F32
+ kYes, // Any UNORM type
+};
+
+static inline GrPixelConfigIsClamped GrGetPixelConfigIsClamped(GrPixelConfig config) {
+ return GrPixelConfigIsFloatingPoint(config) ? GrPixelConfigIsClamped::kNo
+ : GrPixelConfigIsClamped::kYes;
+}
+
+/**
* Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars,
* but should be applicable to other shader languages.)
*/