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

Side by Side Diff: src/codec/SkSwizzler.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/SkScaledCodec.cpp ('k') | src/codec/SkWebpAdapterCodec.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 "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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkScaledCodec.cpp ('k') | src/codec/SkWebpAdapterCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698