OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkXfermode.h" | 9 #include "SkXfermode.h" |
10 #include "SkXfermode_opts_SSE2.h" | 10 #include "SkXfermode_opts_SSE2.h" |
11 #include "SkXfermode_proccoeff.h" | 11 #include "SkXfermode_proccoeff.h" |
12 #include "SkColorPriv.h" | 12 #include "SkColorPriv.h" |
13 #include "SkLazyPtr.h" | 13 #include "SkLazyPtr.h" |
14 #include "SkMathPriv.h" | 14 #include "SkMathPriv.h" |
15 #include "SkPMFloat.h" | 15 #include "SkPMFloat.h" |
16 #include "SkReadBuffer.h" | 16 #include "SkReadBuffer.h" |
17 #include "SkString.h" | 17 #include "SkString.h" |
18 #include "SkUtilsArm.h" | 18 #include "SkUtilsArm.h" |
19 #include "SkWriteBuffer.h" | 19 #include "SkWriteBuffer.h" |
20 | 20 |
21 //#define SK_SUPPORT_LEGACY_SCALAR_XFERMODES | 21 #ifndef SK_SUPPORT_LEGACY_SCALAR_XFERMODES |
| 22 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
| 23 /* |
| 24 * To be conservative, we only enable the new code path (using SkPMFloat) wh
en we |
| 25 * "know" we're faster, which at the moment is only when we have SSE2 or bet
ter. |
| 26 */ |
| 27 #else |
| 28 #define SK_SUPPORT_LEGACY_SCALAR_XFERMODES |
| 29 #endif |
| 30 #endif |
22 | 31 |
23 #if !SK_ARM_NEON_IS_NONE | 32 #if !SK_ARM_NEON_IS_NONE |
24 #include "SkXfermode_opts_arm_neon.h" | 33 #include "SkXfermode_opts_arm_neon.h" |
25 #endif | 34 #endif |
26 | 35 |
27 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b) | 36 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b) |
28 | 37 |
29 static inline unsigned saturated_add(unsigned a, unsigned b) { | 38 static inline unsigned saturated_add(unsigned a, unsigned b) { |
30 SkASSERT(a <= 255); | 39 SkASSERT(a <= 255); |
31 SkASSERT(b <= 255); | 40 SkASSERT(b <= 255); |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 } else { | 1762 } else { |
1754 proc16 = rec.fProc16_General; | 1763 proc16 = rec.fProc16_General; |
1755 } | 1764 } |
1756 } | 1765 } |
1757 return proc16; | 1766 return proc16; |
1758 } | 1767 } |
1759 | 1768 |
1760 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) | 1769 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) |
1761 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) | 1770 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) |
1762 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1771 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |