| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 switch (component) { | 110 switch (component) { |
| 111 case kR_GrColorComponentFlag: | 111 case kR_GrColorComponentFlag: |
| 112 return 'r'; | 112 return 'r'; |
| 113 case kG_GrColorComponentFlag: | 113 case kG_GrColorComponentFlag: |
| 114 return 'g'; | 114 return 'g'; |
| 115 case kB_GrColorComponentFlag: | 115 case kB_GrColorComponentFlag: |
| 116 return 'b'; | 116 return 'b'; |
| 117 case kA_GrColorComponentFlag: | 117 case kA_GrColorComponentFlag: |
| 118 return 'a'; | 118 return 'a'; |
| 119 default: | 119 default: |
| 120 GrCrash("Invalid color component flag."); | 120 SkFAIL("Invalid color component flag."); |
| 121 return '\0'; | 121 return '\0'; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { | 125 static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { |
| 126 SkASSERT(config >= 0 && config < kGrPixelConfigCnt); | 126 SkASSERT(config >= 0 && config < kGrPixelConfigCnt); |
| 127 static const uint32_t kFlags[] = { | 127 static const uint32_t kFlags[] = { |
| 128 0, // kUnknown_GrPixelConfig | 128 0, // kUnknown_GrPixelConfig |
| 129 kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig | 129 kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig |
| 130 kRGBA_GrColorComponentFlags, // kIndex_8_GrPixelConfig | 130 kRGBA_GrColorComponentFlags, // kIndex_8_GrPixelConfig |
| 131 kRGB_GrColorComponentFlags, // kRGB_565_GrPixelConfig | 131 kRGB_GrColorComponentFlags, // kRGB_565_GrPixelConfig |
| 132 kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig | 132 kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig |
| 133 kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig | 133 kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig |
| 134 kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig | 134 kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig |
| 135 }; | 135 }; |
| 136 return kFlags[config]; | 136 return kFlags[config]; |
| 137 | 137 |
| 138 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); | 138 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); |
| 139 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); | 139 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); |
| 140 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); | 140 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); |
| 141 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); | 141 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); |
| 142 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); | 142 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); |
| 143 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); | 143 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); |
| 144 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); | 144 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); |
| 145 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); | 145 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); |
| 146 } | 146 } |
| 147 | 147 |
| 148 #endif | 148 #endif |
| OLD | NEW |