Chromium Code Reviews| 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 zeroAlpha = 0; \ | 24 uint8_t zeroAlpha = 0; \ |
| 25 uint8_t maxAlpha = 0xFF; | 25 uint8_t maxAlpha = 0xFF; |
| 26 | 26 |
| 27 #define UPDATE_RESULT_ALPHA(alpha) \ | 27 #define UPDATE_RESULT_ALPHA(alpha) \ |
| 28 zeroAlpha |= (alpha); \ | 28 zeroAlpha |= (alpha); \ |
| 29 maxAlpha &= (alpha); | 29 maxAlpha &= (alpha); |
| 30 | 30 |
| 31 #define COMPUTE_RESULT_ALPHA \ | 31 #define COMPUTE_RESULT_ALPHA \ |
| 32 SkSwizzler::GetResult(zeroAlpha, maxAlpha); | 32 SkSwizzler::GetResult(zeroAlpha, maxAlpha); |
| 33 | 33 |
| 34 inline float get_scale_from_sample_size(uint32_t sampleSize) { return 1.0f / (fl oat) sampleSize; } | |
|
scroggo
2015/10/08 20:16:07
This change (moving this function here, removing S
msarett
2015/10/09 20:03:44
I'll remove this from the change.
Right now, get_
| |
| 35 | |
| 34 /* | 36 /* |
| 35 * returns a scaled dimension based on the original dimension and the sampleSize | 37 * returns a scaled dimension based on the original dimension and the sampleSize |
| 36 * NOTE: we round down here for scaled dimension to match the behavior of SkImag eDecoder | 38 * NOTE: we round down here for scaled dimension to match the behavior of SkImag eDecoder |
| 37 */ | 39 */ |
| 38 inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 40 inline int get_scaled_dimension(int srcDimension, int sampleSize) { |
| 39 if (sampleSize > srcDimension) { | 41 if (sampleSize > srcDimension) { |
| 40 return 1; | 42 return 1; |
| 41 } | 43 } |
| 42 return srcDimension / sampleSize; | 44 return srcDimension / sampleSize; |
| 43 } | 45 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 #endif | 239 #endif |
| 238 } | 240 } |
| 239 | 241 |
| 240 #ifdef SK_PRINT_CODEC_MESSAGES | 242 #ifdef SK_PRINT_CODEC_MESSAGES |
| 241 #define SkCodecPrintf SkDebugf | 243 #define SkCodecPrintf SkDebugf |
| 242 #else | 244 #else |
| 243 #define SkCodecPrintf(...) | 245 #define SkCodecPrintf(...) |
| 244 #endif | 246 #endif |
| 245 | 247 |
| 246 #endif // SkCodecPriv_DEFINED | 248 #endif // SkCodecPriv_DEFINED |
| OLD | NEW |