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

Side by Side Diff: src/codec/SkCodecPriv.h

Issue 1557403002: Delete reallyHasAlpha() from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 11 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 | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.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 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
11 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
12 #include "SkColorTable.h" 12 #include "SkColorTable.h"
13 #include "SkImageInfo.h" 13 #include "SkImageInfo.h"
14 #include "SkSwizzler.h"
15 #include "SkTypes.h" 14 #include "SkTypes.h"
16 #include "SkUtils.h" 15 #include "SkUtils.h"
17 16
18 /*
19 *
20 * Helper routine for alpha result codes
21 *
22 */
23 #define INIT_RESULT_ALPHA \
24 uint8_t zeroAlpha = 0; \
25 uint8_t maxAlpha = 0xFF;
26
27 #define UPDATE_RESULT_ALPHA(alpha) \
28 zeroAlpha |= (alpha); \
29 maxAlpha &= (alpha);
30
31 #define COMPUTE_RESULT_ALPHA \
32 SkSwizzler::GetResult(zeroAlpha, maxAlpha);
33
34 // FIXME: Consider sharing with dm, nanbench, and tools. 17 // FIXME: Consider sharing with dm, nanbench, and tools.
35 inline float get_scale_from_sample_size(int sampleSize) { 18 inline float get_scale_from_sample_size(int sampleSize) {
36 return 1.0f / ((float) sampleSize); 19 return 1.0f / ((float) sampleSize);
37 } 20 }
38 21
39 inline bool is_valid_subset(const SkIRect& subset, const SkISize& imageDims) { 22 inline bool is_valid_subset(const SkIRect& subset, const SkISize& imageDims) {
40 return SkIRect::MakeSize(imageDims).contains(subset); 23 return SkIRect::MakeSize(imageDims).contains(subset);
41 } 24 }
42 25
43 /* 26 /*
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 #endif 230 #endif
248 } 231 }
249 232
250 #ifdef SK_PRINT_CODEC_MESSAGES 233 #ifdef SK_PRINT_CODEC_MESSAGES
251 #define SkCodecPrintf SkDebugf 234 #define SkCodecPrintf SkDebugf
252 #else 235 #else
253 #define SkCodecPrintf(...) 236 #define SkCodecPrintf(...)
254 #endif 237 #endif
255 238
256 #endif // SkCodecPriv_DEFINED 239 #endif // SkCodecPriv_DEFINED
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698