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 "SkMaskSwizzler.h" | 10 #include "SkMaskSwizzler.h" |
11 #include "SkScaledCodec.h" | |
12 | 11 |
13 static SkSwizzler::ResultAlpha swizzle_mask16_to_n32_opaque( | 12 static SkSwizzler::ResultAlpha swizzle_mask16_to_n32_opaque( |
14 void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks, | 13 void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks, |
15 uint32_t startX, uint32_t sampleX) { | 14 uint32_t startX, uint32_t sampleX) { |
16 | 15 |
17 // Use the masks to decode to the destination | 16 // Use the masks to decode to the destination |
18 uint16_t* srcPtr = ((uint16_t*) srcRow) + startX; | 17 uint16_t* srcPtr = ((uint16_t*) srcRow) + startX; |
19 SkPMColor* dstPtr = (SkPMColor*) dstRow; | 18 SkPMColor* dstPtr = (SkPMColor*) dstRow; |
20 for (int i = 0; i < width; i++) { | 19 for (int i = 0; i < width; i++) { |
21 uint16_t p = srcPtr[0]; | 20 uint16_t p = srcPtr[0]; |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 391 |
393 /* | 392 /* |
394 * | 393 * |
395 * Swizzle the specified row | 394 * Swizzle the specified row |
396 * | 395 * |
397 */ | 396 */ |
398 SkSwizzler::ResultAlpha SkMaskSwizzler::swizzle(void* dst, const uint8_t* SK_RES
TRICT src) { | 397 SkSwizzler::ResultAlpha SkMaskSwizzler::swizzle(void* dst, const uint8_t* SK_RES
TRICT src) { |
399 SkASSERT(nullptr != dst && nullptr != src); | 398 SkASSERT(nullptr != dst && nullptr != src); |
400 return fRowProc(dst, src, fDstWidth, fMasks, fX0, fSampleX); | 399 return fRowProc(dst, src, fDstWidth, fMasks, fX0, fSampleX); |
401 } | 400 } |
OLD | NEW |