Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: src/codec/SkCodecPriv.h

Issue 1305123002: Scanline decoding for gifs (Closed) Base URL: https://skia.googlesource.com/skia.git@real-bmp-scan
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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/24 23:20:12 For debugging, 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698