From 532b3f944a4991064963aee8f535c695f4068368 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 11 Jul 2018 10:02:07 -0400 Subject: 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 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- include/private/GrTypesPriv.h | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'include/private') 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 @@ -282,15 +282,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 -- cgit v1.2.3