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 23 matching lines...) Expand all Loading... |
34 * | 34 * |
35 * Copy the codec color table back to the client when kIndex8 color type is requ
ested | 35 * Copy the codec color table back to the client when kIndex8 color type is requ
ested |
36 * | 36 * |
37 */ | 37 */ |
38 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co
lorTable, | 38 static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* co
lorTable, |
39 SkPMColor* inputColorPtr, int* inputColorCount) { | 39 SkPMColor* inputColorPtr, int* inputColorCount) { |
40 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 40 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
41 SkASSERT(NULL != inputColorPtr); | 41 SkASSERT(NULL != inputColorPtr); |
42 SkASSERT(NULL != inputColorCount); | 42 SkASSERT(NULL != inputColorCount); |
43 SkASSERT(NULL != colorTable); | 43 SkASSERT(NULL != colorTable); |
44 sk_memcpy32(inputColorPtr, colorTable->readColors(), *inputColorCount); | 44 memcpy(inputColorPtr, colorTable->readColors(), *inputColorCount * 4); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 /* | 48 /* |
49 * | 49 * |
50 * Compute row bytes for an image using pixels per byte | 50 * Compute row bytes for an image using pixels per byte |
51 * | 51 * |
52 */ | 52 */ |
53 static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { | 53 static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { |
54 return (width + pixelsPerByte - 1) / pixelsPerByte; | 54 return (width + pixelsPerByte - 1) / pixelsPerByte; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 #endif | 122 #endif |
123 } | 123 } |
124 | 124 |
125 #ifdef SK_PRINT_CODEC_MESSAGES | 125 #ifdef SK_PRINT_CODEC_MESSAGES |
126 #define SkCodecPrintf SkDebugf | 126 #define SkCodecPrintf SkDebugf |
127 #else | 127 #else |
128 #define SkCodecPrintf(...) | 128 #define SkCodecPrintf(...) |
129 #endif | 129 #endif |
130 | 130 |
131 #endif // SkCodecPriv_DEFINED | 131 #endif // SkCodecPriv_DEFINED |
OLD | NEW |