OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkLumaXfermode.h" | 8 #include "SkLumaXfermode.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 int count, const SkAlpha aa[]) const { | 69 int count, const SkAlpha aa[]) const { |
70 const SkPMColor* a = lumaOpA<SkPMColor>(fMode, src, dst); | 70 const SkPMColor* a = lumaOpA<SkPMColor>(fMode, src, dst); |
71 const SkPMColor* b = lumaOpB<SkPMColor>(fMode, src, dst); | 71 const SkPMColor* b = lumaOpB<SkPMColor>(fMode, src, dst); |
72 | 72 |
73 if (aa) { | 73 if (aa) { |
74 for (int i = 0; i < count; ++i) { | 74 for (int i = 0; i < count; ++i) { |
75 unsigned cov = aa[i]; | 75 unsigned cov = aa[i]; |
76 if (cov) { | 76 if (cov) { |
77 unsigned resC = luma_proc(a[i], b[i]); | 77 unsigned resC = luma_proc(a[i], b[i]); |
78 if (cov < 255) { | 78 if (cov < 255) { |
79 resC = SkAlphaMulQ(resC, SkAlpha255To256(cov)); | 79 resC = SkFastFourByteInterp256(resC, dst[i], |
| 80 SkAlpha255To256(cov)); |
80 } | 81 } |
81 dst[i] = resC; | 82 dst[i] = resC; |
82 } | 83 } |
83 } | 84 } |
84 } else { | 85 } else { |
85 for (int i = 0; i < count; ++i) { | 86 for (int i = 0; i < count; ++i) { |
86 dst[i] = luma_proc(a[i], b[i]); | 87 dst[i] = luma_proc(a[i], b[i]); |
87 } | 88 } |
88 } | 89 } |
89 } | 90 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // No background texture support. | 213 // No background texture support. |
213 if (effect && !background) { | 214 if (effect && !background) { |
214 *effect = GrLumaMaskEffect::Create(fMode); | 215 *effect = GrLumaMaskEffect::Create(fMode); |
215 return true; | 216 return true; |
216 } | 217 } |
217 | 218 |
218 return false; | 219 return false; |
219 } | 220 } |
220 | 221 |
221 #endif // SK_SUPPORT_GPU | 222 #endif // SK_SUPPORT_GPU |
OLD | NEW |