OLD | NEW |
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 #ifndef SkBlitRow_opts_DEFINED | 8 #ifndef SkBlitRow_opts_DEFINED |
9 #define SkBlitRow_opts_DEFINED | 9 #define SkBlitRow_opts_DEFINED |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 vst1_u32(dst+0, vreinterpret_u32_u8(dst0)); | 183 vst1_u32(dst+0, vreinterpret_u32_u8(dst0)); |
184 vst1_u32(dst+2, vreinterpret_u32_u8(dst2)); | 184 vst1_u32(dst+2, vreinterpret_u32_u8(dst2)); |
185 | 185 |
186 src += 4; | 186 src += 4; |
187 dst += 4; | 187 dst += 4; |
188 len -= 4; | 188 len -= 4; |
189 } | 189 } |
190 #endif | 190 #endif |
191 | 191 |
192 while (len-- > 0) { | 192 while (len-- > 0) { |
193 if (*src) { | 193 // This 0xFF000000 is not semantically necessary, but for compatibility |
| 194 // with chromium:611002 we need to keep it until we figure out where |
| 195 // the non-premultiplied src values (like 0x00FFFFFF) are coming from. |
| 196 // TODO(mtklein): sort this out and assert *src is premul here. |
| 197 if (*src & 0xFF000000) { |
194 *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst); | 198 *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst); |
195 } | 199 } |
196 src++; | 200 src++; |
197 dst++; | 201 dst++; |
198 } | 202 } |
199 } | 203 } |
200 | 204 |
201 } // SK_OPTS_NS | 205 } // SK_OPTS_NS |
202 | 206 |
203 #endif//SkBlitRow_opts_DEFINED | 207 #endif//SkBlitRow_opts_DEFINED |
OLD | NEW |