diff options
author | Greg Daniel <egdaniel@google.com> | 2017-12-05 16:27:11 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-07 20:52:40 +0000 |
commit | 7af060a8bcc250af00b0dadaf10d414765dc94f9 (patch) | |
tree | 282a8c41b0a49b70640ce280d89142dc668d18df /include | |
parent | 4e5029744d5adc542857ca506607e2135d288e57 (diff) |
Add gray_8_as_lum and _as_red private grpixelconfigs
Bug: skia:
Change-Id: I70cbd0bc9f7a7a16fb9f0688d272d7afa607700a
Reviewed-on: https://skia-review.googlesource.com/80622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
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: |