diff options
author | Brian Osman <brianosman@google.com> | 2017-01-12 10:28:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-12 16:22:06 +0000 |
commit | 78f20e0e97472c39377bcb610d845ae6ef5d6ace (patch) | |
tree | dc4b776a5ad4cad2ab051301e6cc64c4560d4f0b /include/gpu | |
parent | 062990bc7a8a667d6282ff73188589e57c7607ed (diff) |
Cleanup GrPixelConfig helper functions
Remove unused functions, and convert another to switch style.
BUG=skia:
Change-Id: I93edbece54f147d868801bb008e6f935a8cb997f
Reviewed-on: https://skia-review.googlesource.com/6947
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrColor.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h index 0403e48423..cebceea2d0 100644 --- a/include/gpu/GrColor.h +++ b/include/gpu/GrColor.h @@ -267,63 +267,4 @@ enum GrColorComponentFlags { GR_MAKE_BITFIELD_OPS(GrColorComponentFlags) -static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) { - SkASSERT(SkIsPow2(component)); - switch (component) { - case kR_GrColorComponentFlag: - return 'r'; - case kG_GrColorComponentFlag: - return 'g'; - case kB_GrColorComponentFlag: - return 'b'; - case kA_GrColorComponentFlag: - return 'a'; - default: - SkFAIL("Invalid color component flag."); - return '\0'; - } -} - -static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { - static const uint32_t kFlags[] = { - 0, // kUnknown_GrPixelConfig - kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig - kRGB_GrColorComponentFlags, // kGray_8_GrPixelConfig - kRGB_GrColorComponentFlags, // kRGB_565_GrPixelConfig - kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig - kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig - kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig - kRGBA_GrColorComponentFlags, // kSRGBA_8888_GrPixelConfig - kRGBA_GrColorComponentFlags, // kSBGRA_8888_GrPixelConfig - kRGBA_GrColorComponentFlags, // kRGBA_8888_sint_GrPixelConfig - kRGB_GrColorComponentFlags, // kETC1_GrPixelConfig - kA_GrColorComponentFlag, // kLATC_GrPixelConfig - kA_GrColorComponentFlag, // kR11_EAC_GrPixelConfig - kRGBA_GrColorComponentFlags, // kASTC_12x12_GrPixelConfig - kRGBA_GrColorComponentFlags, // kRGBA_float_GrPixelConfig - kA_GrColorComponentFlag, // kAlpha_16_GrPixelConfig - kRGBA_GrColorComponentFlags, // kRGBA_half_GrPixelConfig - }; - return kFlags[config]; - - GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); - GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); - GR_STATIC_ASSERT(2 == kGray_8_GrPixelConfig); - GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); - GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); - GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); - GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); - GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig); - GR_STATIC_ASSERT(8 == kSBGRA_8888_GrPixelConfig); - GR_STATIC_ASSERT(9 == kRGBA_8888_sint_GrPixelConfig); - GR_STATIC_ASSERT(10 == kETC1_GrPixelConfig); - GR_STATIC_ASSERT(11 == kLATC_GrPixelConfig); - GR_STATIC_ASSERT(12 == kR11_EAC_GrPixelConfig); - GR_STATIC_ASSERT(13 == kASTC_12x12_GrPixelConfig); - GR_STATIC_ASSERT(14 == kRGBA_float_GrPixelConfig); - GR_STATIC_ASSERT(15 == kAlpha_half_GrPixelConfig); - GR_STATIC_ASSERT(16 == kRGBA_half_GrPixelConfig); - GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); -} - #endif |