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 #ifndef SkArithmeticModePriv_DEFINED | 8 #ifndef SkArithmeticModePriv_DEFINED |
9 #define SkArithmeticModePriv_DEFINED | 9 #define SkArithmeticModePriv_DEFINED |
10 | 10 |
11 #include "SkArithmeticMode.h" | 11 #include "SkArithmeticMode.h" |
12 | 12 |
| 13 struct SkArithmeticParams { |
| 14 float fK[4]; |
| 15 bool fEnforcePMColor; |
| 16 }; |
| 17 |
13 #ifndef SK_SUPPORT_LEGACY_ARITHMETICMODE | 18 #ifndef SK_SUPPORT_LEGACY_ARITHMETICMODE |
14 | 19 |
15 class SK_API SkArithmeticMode { | 20 class SK_API SkArithmeticMode { |
16 public: | 21 public: |
17 /** | 22 /** |
18 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4] | 23 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4] |
19 * | 24 * |
20 * k1=k2=k3=0, k4=1.0 results in returning opaque white | 25 * k1=k2=k3=0, k4=1.0 results in returning opaque white |
21 * k1=k3=k4=0, k2=1.0 results in returning the src | 26 * k1=k3=k4=0, k2=1.0 results in returning the src |
22 * k1=k2=k4=0, k3=1.0 results in returning the dst | 27 * k1=k2=k4=0, k3=1.0 results in returning the dst |
(...skipping 10 matching lines...) Expand all Loading... |
33 | 38 |
34 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); | 39 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); |
35 | 40 |
36 private: | 41 private: |
37 SkArithmeticMode(); // can't be instantiated | 42 SkArithmeticMode(); // can't be instantiated |
38 }; | 43 }; |
39 | 44 |
40 #endif | 45 #endif |
41 | 46 |
42 #endif | 47 #endif |
OLD | NEW |