diff options
author | Brian Osman <brianosman@google.com> | 2018-07-11 10:02:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-11 14:30:58 +0000 |
commit | 532b3f944a4991064963aee8f535c695f4068368 (patch) | |
tree | 671769fb6808a70240c1f857594e7f36b4ae8074 /include | |
parent | c87cfb674bcaf27062dd11f88f1337af70173a11 (diff) |
Remove clamping of kPlus with F16 configs
The most common use-case for F16 is to draw things that are explicitly
outside of [0,1]. We can't prevent out-of-range values in general, users
could just draw out-of-range content in src mode. We've decided that
it's best to avoid surprising behavior, and trust the user in these
situations.
This effectively reverts https://skia-review.googlesource.com/c/skia/+/48183
Bug: skia:
Change-Id: I71c2dd925c567e2862d96ab70c752f19245a69c4
Reviewed-on: https://skia-review.googlesource.com/140500
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/GrTypesPriv.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index 1c2af04a0a..1490574193 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -283,15 +283,6 @@ enum class GrAllowMixedSamples : bool { kNo = false, kYes = true }; 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 = false, // F16 or F32 - kYes = true, // Any UNORM type -}; - -/** * Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars, * but should be applicable to other shader languages.) */ @@ -1075,35 +1066,6 @@ static inline bool GrPixelConfigIsAlphaOnly(GrPixelConfig config) { return false; } -static inline bool GrPixelConfigIsFloatingPoint(GrPixelConfig config) { - switch (config) { - case kRGBA_float_GrPixelConfig: - case kRG_float_GrPixelConfig: - case kAlpha_half_GrPixelConfig: - case kAlpha_half_as_Red_GrPixelConfig: - case kRGBA_half_GrPixelConfig: - return true; - case kUnknown_GrPixelConfig: - case kAlpha_8_GrPixelConfig: - case kAlpha_8_as_Alpha_GrPixelConfig: - case kAlpha_8_as_Red_GrPixelConfig: - case kGray_8_GrPixelConfig: - case kGray_8_as_Lum_GrPixelConfig: - case kGray_8_as_Red_GrPixelConfig: - case kRGB_565_GrPixelConfig: - case kRGBA_4444_GrPixelConfig: - case kRGBA_8888_GrPixelConfig: - case kRGB_888_GrPixelConfig: - case kBGRA_8888_GrPixelConfig: - case kSRGBA_8888_GrPixelConfig: - case kSBGRA_8888_GrPixelConfig: - case kRGBA_1010102_GrPixelConfig: - return false; - } - SK_ABORT("Invalid pixel config"); - return false; -} - /** * Precision qualifier that should be used with a sampler. */ @@ -1137,11 +1099,6 @@ static inline GrSLPrecision GrSLSamplerPrecision(GrPixelConfig config) { return kHigh_GrSLPrecision; } -static inline GrPixelConfigIsClamped GrGetPixelConfigIsClamped(GrPixelConfig config) { - return GrPixelConfigIsFloatingPoint(config) ? GrPixelConfigIsClamped::kNo - : GrPixelConfigIsClamped::kYes; -} - /** * Like SkColorType this describes a layout of pixel data in CPU memory. It specifies the channels, * their type, and width. This exists so that the GPU backend can have private types that have no |