Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: src/codec/SkMaskSwizzler.cpp

Issue 1406223002: Create an SkAndroidCodec API separate from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Win bot fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/codec/SkSampledCodec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/codec/SkSampledCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698