| 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_proccoeff.h" | 10 #include "SkXfermode_proccoeff.h" |
| 11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 12 #include "SkLazyPtr.h" | 12 #include "SkLazyPtr.h" |
| 13 #include "SkMathPriv.h" | 13 #include "SkMathPriv.h" |
| 14 #include "SkOpts.h" | 14 #include "SkOpts.h" |
| 15 #include "SkPMFloat.h" | |
| 16 #include "SkReadBuffer.h" | 15 #include "SkReadBuffer.h" |
| 17 #include "SkString.h" | 16 #include "SkString.h" |
| 18 #include "SkWriteBuffer.h" | 17 #include "SkWriteBuffer.h" |
| 19 | 18 |
| 20 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b) | 19 #define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b) |
| 21 | 20 |
| 22 static inline unsigned saturated_add(unsigned a, unsigned b) { | 21 static inline unsigned saturated_add(unsigned a, unsigned b) { |
| 23 SkASSERT(a <= 255); | 22 SkASSERT(a <= 255); |
| 24 SkASSERT(b <= 255); | 23 SkASSERT(b <= 255); |
| 25 unsigned sum = a + b; | 24 unsigned sum = a + b; |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 if (!xfer) { | 1093 if (!xfer) { |
| 1095 return SkXfermode::kOpaque_SrcColorOpacity == opacityType; | 1094 return SkXfermode::kOpaque_SrcColorOpacity == opacityType; |
| 1096 } | 1095 } |
| 1097 | 1096 |
| 1098 return xfer->isOpaque(opacityType); | 1097 return xfer->isOpaque(opacityType); |
| 1099 } | 1098 } |
| 1100 | 1099 |
| 1101 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) | 1100 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) |
| 1102 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) | 1101 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) |
| 1103 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1102 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |