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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 // Need a color xform when dst space does not match the src. | 325 // Need a color xform when dst space does not match the src. |
326 bool srcDstNotEqual = !SkColorSpace::Equals(srcInfo.colorSpace(), dstInfo.co
lorSpace()); | 326 bool srcDstNotEqual = !SkColorSpace::Equals(srcInfo.colorSpace(), dstInfo.co
lorSpace()); |
327 | 327 |
328 // We never perform a color xform in legacy mode. | 328 // We never perform a color xform in legacy mode. |
329 bool isLegacy = nullptr == dstInfo.colorSpace(); | 329 bool isLegacy = nullptr == dstInfo.colorSpace(); |
330 | 330 |
331 return !isLegacy && (needsPremul || isF16 || srcDstNotEqual); | 331 return !isLegacy && (needsPremul || isF16 || srcDstNotEqual); |
332 } | 332 } |
333 | 333 |
| 334 static inline SkAlphaType select_alpha_xform(SkAlphaType dstAlphaType, SkAlphaTy
pe srcAlphaType) { |
| 335 return (kOpaque_SkAlphaType == srcAlphaType) ? kOpaque_SkAlphaType : dstAlph
aType; |
| 336 } |
| 337 |
334 #endif // SkCodecPriv_DEFINED | 338 #endif // SkCodecPriv_DEFINED |
OLD | NEW |