diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrTypes.h | 4 | ||||
-rw-r--r-- | include/private/GrTypesPriv.h | 22 |
2 files changed, 24 insertions, 2 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 59add784a3..08eb2daa98 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -340,8 +340,10 @@ enum GrPixelConfig { kPrivateConfig1_GrPixelConfig, kPrivateConfig2_GrPixelConfig, kPrivateConfig3_GrPixelConfig, + kPrivateConfig4_GrPixelConfig, + kPrivateConfig5_GrPixelConfig, - kLast_GrPixelConfig = kPrivateConfig3_GrPixelConfig + kLast_GrPixelConfig = kPrivateConfig5_GrPixelConfig }; static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index 6472b3f2a3..2da1f86b19 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -763,11 +763,13 @@ GR_MAKE_BITFIELD_CLASS_OPS(GpuPathRenderers) /** * We want to extend the GrPixelConfig enum to add cases for dealing with alpha_8 which is - * internally either alpha8 or red8 + * internally either alpha8 or red8. Also for Gray_8 which can be luminance_8 or red_8. */ static constexpr GrPixelConfig kAlpha_8_as_Alpha_GrPixelConfig = kPrivateConfig1_GrPixelConfig; static constexpr GrPixelConfig kAlpha_8_as_Red_GrPixelConfig = kPrivateConfig2_GrPixelConfig; static constexpr GrPixelConfig kAlpha_half_as_Red_GrPixelConfig = kPrivateConfig3_GrPixelConfig; +static constexpr GrPixelConfig kGray_8_as_Lum_GrPixelConfig = kPrivateConfig4_GrPixelConfig; +static constexpr GrPixelConfig kGray_8_as_Red_GrPixelConfig = kPrivateConfig5_GrPixelConfig; /** * Utility functions for GrPixelConfig @@ -785,6 +787,8 @@ static inline bool GrPixelConfigIs8888Unorm(GrPixelConfig config) { 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_sint_GrPixelConfig: @@ -811,6 +815,8 @@ static inline bool GrPixelConfigIsSRGB(GrPixelConfig config) { 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: @@ -844,6 +850,8 @@ static inline GrPixelConfig GrPixelConfigSwapRAndB(GrPixelConfig config) { 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_sint_GrPixelConfig: @@ -864,6 +872,8 @@ static inline size_t GrBytesPerPixel(GrPixelConfig config) { 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: return 1; case kRGB_565_GrPixelConfig: case kRGBA_4444_GrPixelConfig: @@ -893,6 +903,8 @@ static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) { switch (config) { case kRGB_565_GrPixelConfig: case kGray_8_GrPixelConfig: + case kGray_8_as_Lum_GrPixelConfig: + case kGray_8_as_Red_GrPixelConfig: case kRG_float_GrPixelConfig: return true; case kAlpha_8_GrPixelConfig: @@ -925,6 +937,8 @@ static inline bool GrPixelConfigIsAlphaOnly(GrPixelConfig config) { return true; case kUnknown_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: @@ -954,6 +968,8 @@ static inline bool GrPixelConfigIsFloatingPoint(GrPixelConfig config) { 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: @@ -977,6 +993,8 @@ static inline bool GrPixelConfigIsUnorm(GrPixelConfig config) { 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: @@ -1007,6 +1025,8 @@ static inline GrSLPrecision GrSLSamplerPrecision(GrPixelConfig config) { 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: |