OLD | NEW |
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 Loading... |
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 | |
79 #if defined(SK_PMCOLOR_IS_RGBA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA | 74 #if defined(SK_PMCOLOR_IS_RGBA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA |
80 #error "SK_PMCOLOR_IS_RGBA does not match SK_*32_SHIFT values" | 75 #error "SK_PMCOLOR_IS_RGBA does not match SK_*32_SHIFT values" |
81 #endif | 76 #endif |
82 | 77 |
83 #if defined(SK_PMCOLOR_IS_BGRA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA | 78 #if defined(SK_PMCOLOR_IS_BGRA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA |
84 #error "SK_PMCOLOR_IS_BGRA does not match SK_*32_SHIFT values" | 79 #error "SK_PMCOLOR_IS_BGRA does not match SK_*32_SHIFT values" |
85 #endif | 80 #endif |
86 | 81 |
87 #if !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA) | 82 #if !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA) |
88 // deduce which to define from the _SHIFT defines | 83 // deduce which to define from the _SHIFT defines |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 int srcG = SkColorGetG(src); | 1053 int srcG = SkColorGetG(src); |
1059 int srcB = SkColorGetB(src); | 1054 int srcB = SkColorGetB(src); |
1060 | 1055 |
1061 for (int i = 0; i < width; i++) { | 1056 for (int i = 0; i < width; i++) { |
1062 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i], | 1057 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i], |
1063 opaqueDst); | 1058 opaqueDst); |
1064 } | 1059 } |
1065 } | 1060 } |
1066 | 1061 |
1067 #endif | 1062 #endif |
OLD | NEW |