OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkHalf.h" | 8 #include "SkHalf.h" |
9 #include "SkPM4fPriv.h" | 9 #include "SkPM4fPriv.h" |
10 #include "SkUtils.h" | 10 #include "SkUtils.h" |
11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
12 | 12 |
13 static void sk_memset64(uint64_t dst[], uint64_t value, int count) { | |
14 for (int i = 0; i < count; ++i) { | |
15 dst[i] = value; | |
16 } | |
17 } | |
18 | |
19 enum DstType { | 13 enum DstType { |
20 kU16_Dst, | 14 kU16_Dst, |
21 kF16_Dst, | 15 kF16_Dst, |
22 }; | 16 }; |
23 | 17 |
24 static Sk4f lerp_by_coverage(const Sk4f& src, const Sk4f& dst, uint8_t srcCovera
ge) { | 18 static Sk4f lerp_by_coverage(const Sk4f& src, const Sk4f& dst, uint8_t srcCovera
ge) { |
25 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f)); | 19 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f)); |
26 } | 20 } |
27 | 21 |
28 template <DstType D> Sk4f unit_to_bias(const Sk4f& x4) { | 22 template <DstType D> Sk4f unit_to_bias(const Sk4f& x4) { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 flags &= 7; | 240 flags &= 7; |
247 | 241 |
248 Mode mode; | 242 Mode mode; |
249 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags]; | 243 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags]; |
250 } | 244 } |
251 | 245 |
252 SkXfermode::D64Proc SkXfermode::GetD64Proc(SkXfermode* xfer, uint32_t flags) { | 246 SkXfermode::D64Proc SkXfermode::GetD64Proc(SkXfermode* xfer, uint32_t flags) { |
253 return xfer ? xfer->onGetD64Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod
e, flags); | 247 return xfer ? xfer->onGetD64Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod
e, flags); |
254 } | 248 } |
255 | 249 |
OLD | NEW |