| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 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 #include "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkScaledCodec.h" | |
| 11 #include "SkSwizzler.h" | 10 #include "SkSwizzler.h" |
| 12 #include "SkTemplates.h" | 11 #include "SkTemplates.h" |
| 13 | 12 |
| 14 SkSwizzler::ResultAlpha SkSwizzler::GetResult(uint8_t zeroAlpha, | 13 SkSwizzler::ResultAlpha SkSwizzler::GetResult(uint8_t zeroAlpha, |
| 15 uint8_t maxAlpha) { | 14 uint8_t maxAlpha) { |
| 16 // In the transparent case, this returns 0x0000 | 15 // In the transparent case, this returns 0x0000 |
| 17 // In the opaque case, this returns 0xFFFF | 16 // In the opaque case, this returns 0xFFFF |
| 18 // If the row is neither transparent nor opaque, returns something else | 17 // If the row is neither transparent nor opaque, returns something else |
| 19 return (((uint16_t) maxAlpha) << 8) | zeroAlpha; | 18 return (((uint16_t) maxAlpha) << 8) | zeroAlpha; |
| 20 } | 19 } |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 713 |
| 715 // check that fX0 is valid | 714 // check that fX0 is valid |
| 716 SkASSERT(fX0 >= 0); | 715 SkASSERT(fX0 >= 0); |
| 717 return fDstWidth; | 716 return fDstWidth; |
| 718 } | 717 } |
| 719 | 718 |
| 720 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC
T src) { | 719 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC
T src) { |
| 721 SkASSERT(nullptr != dst && nullptr != src); | 720 SkASSERT(nullptr != dst && nullptr != src); |
| 722 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol
orTable); | 721 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol
orTable); |
| 723 } | 722 } |
| OLD | NEW |