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

Side by Side Diff: include/core/SkColorPriv.h

Issue 1622483002: Revert[2] of float color components (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix inversion of unpremul check 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/core/SkColorFilter.h ('k') | include/core/SkShader.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 2006 The Android Open Source Project 2 * Copyright 2006 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 SkColorPriv_DEFINED 8 #ifndef SkColorPriv_DEFINED
9 #define SkColorPriv_DEFINED 9 #define SkColorPriv_DEFINED
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 SK_G32_SHIFT == SK_RGBA_G32_SHIFT && \ 64 SK_G32_SHIFT == SK_RGBA_G32_SHIFT && \
65 SK_B32_SHIFT == SK_RGBA_B32_SHIFT) 65 SK_B32_SHIFT == SK_RGBA_B32_SHIFT)
66 66
67 #define LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA \ 67 #define LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA \
68 (SK_A32_SHIFT == SK_BGRA_A32_SHIFT && \ 68 (SK_A32_SHIFT == SK_BGRA_A32_SHIFT && \
69 SK_R32_SHIFT == SK_BGRA_R32_SHIFT && \ 69 SK_R32_SHIFT == SK_BGRA_R32_SHIFT && \
70 SK_G32_SHIFT == SK_BGRA_G32_SHIFT && \ 70 SK_G32_SHIFT == SK_BGRA_G32_SHIFT && \
71 SK_B32_SHIFT == SK_BGRA_B32_SHIFT) 71 SK_B32_SHIFT == SK_BGRA_B32_SHIFT)
72 72
73 73
74 #define SK_A_INDEX (SK_A32_SHIFT/8)
75 #define SK_R_INDEX (SK_R32_SHIFT/8)
76 #define SK_G_INDEX (SK_G32_SHIFT/8)
77 #define SK_B_INDEX (SK_B32_SHIFT/8)
78
74 #if defined(SK_PMCOLOR_IS_RGBA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA 79 #if defined(SK_PMCOLOR_IS_RGBA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA
75 #error "SK_PMCOLOR_IS_RGBA does not match SK_*32_SHIFT values" 80 #error "SK_PMCOLOR_IS_RGBA does not match SK_*32_SHIFT values"
76 #endif 81 #endif
77 82
78 #if defined(SK_PMCOLOR_IS_BGRA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA 83 #if defined(SK_PMCOLOR_IS_BGRA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA
79 #error "SK_PMCOLOR_IS_BGRA does not match SK_*32_SHIFT values" 84 #error "SK_PMCOLOR_IS_BGRA does not match SK_*32_SHIFT values"
80 #endif 85 #endif
81 86
82 #if !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA) 87 #if !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA)
83 // deduce which to define from the _SHIFT defines 88 // deduce which to define from the _SHIFT defines
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 int srcG = SkColorGetG(src); 1058 int srcG = SkColorGetG(src);
1054 int srcB = SkColorGetB(src); 1059 int srcB = SkColorGetB(src);
1055 1060
1056 for (int i = 0; i < width; i++) { 1061 for (int i = 0; i < width; i++) {
1057 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i], 1062 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i],
1058 opaqueDst); 1063 opaqueDst);
1059 } 1064 }
1060 } 1065 }
1061 1066
1062 #endif 1067 #endif
OLDNEW
« no previous file with comments | « include/core/SkColorFilter.h ('k') | include/core/SkShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698