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 |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkColorTable.h" | 12 #include "SkColorTable.h" |
13 #include "SkImageInfo.h" | 13 #include "SkImageInfo.h" |
14 #include "SkTypes.h" | 14 #include "SkTypes.h" |
15 #include "SkUtils.h" | |
16 | 15 |
17 #ifdef SK_PRINT_CODEC_MESSAGES | 16 #ifdef SK_PRINT_CODEC_MESSAGES |
18 #define SkCodecPrintf SkDebugf | 17 #define SkCodecPrintf SkDebugf |
19 #else | 18 #else |
20 #define SkCodecPrintf(...) | 19 #define SkCodecPrintf(...) |
21 #endif | 20 #endif |
22 | 21 |
23 // FIXME: Consider sharing with dm, nanbench, and tools. | 22 // FIXME: Consider sharing with dm, nanbench, and tools. |
24 inline float get_scale_from_sample_size(int sampleSize) { | 23 inline float get_scale_from_sample_size(int sampleSize) { |
25 return 1.0f / ((float) sampleSize); | 24 return 1.0f / ((float) sampleSize); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 uint32_t result; | 245 uint32_t result; |
247 memcpy(&result, &(buffer[i]), 4); | 246 memcpy(&result, &(buffer[i]), 4); |
248 #ifdef SK_CPU_BENDIAN | 247 #ifdef SK_CPU_BENDIAN |
249 return SkEndianSwap32(result); | 248 return SkEndianSwap32(result); |
250 #else | 249 #else |
251 return result; | 250 return result; |
252 #endif | 251 #endif |
253 } | 252 } |
254 | 253 |
255 #endif // SkCodecPriv_DEFINED | 254 #endif // SkCodecPriv_DEFINED |
OLD | NEW |