diff options
author | 2017-09-20 09:53:22 -0400 | |
---|---|---|
committer | 2017-09-20 14:28:03 +0000 | |
commit | 9a725dd9485654155e2e4196c32d372360bcdb61 (patch) | |
tree | 7b2b226fdffc212cce21de7d7804308dc7abbf92 /include/private | |
parent | 906126eedc792f12935145a9a2f13eea1d1cd86d (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.h | 14 |
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.) */ |