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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 /* | 91 /* |
92 * | 92 * |
93 * Copy the codec color table back to the client when kIndex8 color type is requ ested | 93 * Copy the codec color table back to the client when kIndex8 color type is requ ested |
94 */ | 94 */ |
95 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co lorTable, | 95 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co lorTable, |
96 SkPMColor* inputColorPtr, int* inputColorCount) { | 96 SkPMColor* inputColorPtr, int* inputColorCount) { |
97 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 97 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
98 SkASSERT(NULL != inputColorPtr); | 98 SkASSERT(NULL != inputColorPtr); |
99 SkASSERT(NULL != inputColorCount); | 99 SkASSERT(NULL != inputColorCount); |
100 SkASSERT(NULL != colorTable); | 100 SkASSERT(NULL != colorTable); |
101 memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * 4); | 101 memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * sizeo f(SkPMColor)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 /* | 105 /* |
106 * Compute row bytes for an image using pixels per byte | 106 * Compute row bytes for an image using pixels per byte |
107 */ | 107 */ |
108 static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { | 108 static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { |
109 return (width + pixelsPerByte - 1) / pixelsPerByte; | 109 return (width + pixelsPerByte - 1) / pixelsPerByte; |
110 } | 110 } |
111 | 111 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 static inline uint32_t get_int(uint8_t* buffer, uint32_t i) { | 177 static inline uint32_t get_int(uint8_t* buffer, uint32_t i) { |
178 uint32_t result; | 178 uint32_t result; |
179 memcpy(&result, &(buffer[i]), 4); | 179 memcpy(&result, &(buffer[i]), 4); |
180 #ifdef SK_CPU_BENDIAN | 180 #ifdef SK_CPU_BENDIAN |
181 return SkEndianSwap32(result); | 181 return SkEndianSwap32(result); |
182 #else | 182 #else |
183 return result; | 183 return result; |
184 #endif | 184 #endif |
185 } | 185 } |
186 | 186 |
187 #ifdef SK_PRINT_CODEC_MESSAGES | 187 #ifndef SK_PRINT_CODEC_MESSAGES |
msarett
2015/08/25 13:46:38
Will fix.
| |
188 #define SkCodecPrintf SkDebugf | 188 #define SkCodecPrintf SkDebugf |
189 #else | 189 #else |
190 #define SkCodecPrintf(...) | 190 #define SkCodecPrintf(...) |
191 #endif | 191 #endif |
192 | 192 |
193 #endif // SkCodecPriv_DEFINED | 193 #endif // SkCodecPriv_DEFINED |
OLD | NEW |