OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The Android Open Source Project | 2 * Copyright 2015 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkCodecPriv_DEFINED | 8 #ifndef SkCodecPriv_DEFINED |
9 #define SkCodecPriv_DEFINED | 9 #define SkCodecPriv_DEFINED |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 uint8_t maxAlpha = 0xFF; | 24 uint8_t maxAlpha = 0xFF; |
25 | 25 |
26 #define UPDATE_RESULT_ALPHA(alpha) \ | 26 #define UPDATE_RESULT_ALPHA(alpha) \ |
27 zeroAlpha |= (alpha); \ | 27 zeroAlpha |= (alpha); \ |
28 maxAlpha &= (alpha); | 28 maxAlpha &= (alpha); |
29 | 29 |
30 #define COMPUTE_RESULT_ALPHA \ | 30 #define COMPUTE_RESULT_ALPHA \ |
31 SkSwizzler::GetResult(zeroAlpha, maxAlpha); | 31 SkSwizzler::GetResult(zeroAlpha, maxAlpha); |
32 | 32 |
33 /* | 33 /* |
| 34 * If there is a color table, get a pointer to the colors, otherwise return NULL |
| 35 */ |
| 36 static const SkPMColor* get_color_ptr(SkColorTable* colorTable) { |
| 37 return NULL != colorTable ? colorTable->readColors() : NULL; |
| 38 } |
| 39 |
| 40 /* |
34 * | 41 * |
35 * Copy the codec color table back to the client when kIndex8 color type is requ
ested | 42 * Copy the codec color table back to the client when kIndex8 color type is requ
ested |
36 * | 43 * |
37 */ | 44 */ |
38 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co
lorTable, | 45 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co
lorTable, |
39 SkPMColor* inputColorPtr, int* inputColorCount) { | 46 SkPMColor* inputColorPtr, int* inputColorCount) { |
40 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 47 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
41 SkASSERT(NULL != inputColorPtr); | 48 SkASSERT(NULL != inputColorPtr); |
42 SkASSERT(NULL != inputColorCount); | 49 SkASSERT(NULL != inputColorCount); |
43 SkASSERT(NULL != colorTable); | 50 SkASSERT(NULL != colorTable); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 #endif | 129 #endif |
123 } | 130 } |
124 | 131 |
125 #ifdef SK_PRINT_CODEC_MESSAGES | 132 #ifdef SK_PRINT_CODEC_MESSAGES |
126 #define SkCodecPrintf SkDebugf | 133 #define SkCodecPrintf SkDebugf |
127 #else | 134 #else |
128 #define SkCodecPrintf(...) | 135 #define SkCodecPrintf(...) |
129 #endif | 136 #endif |
130 | 137 |
131 #endif // SkCodecPriv_DEFINED | 138 #endif // SkCodecPriv_DEFINED |
OLD | NEW |