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 SkArithmeticMode_gpu_DEFINED | 8 #ifndef SkArithmeticMode_gpu_DEFINED |
9 #define SkArithmeticMode_gpu_DEFINED | 9 #define SkArithmeticMode_gpu_DEFINED |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 bool canTweakAlphaForCoverage() const SK_OVERRIDE { | 89 bool canTweakAlphaForCoverage() const SK_OVERRIDE { |
90 return false; | 90 return false; |
91 } | 91 } |
92 | 92 |
93 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 93 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
94 GrXPFactory::InvariantOutput*) const SK_OVERRIDE; | 94 GrXPFactory::InvariantOutput*) const SK_OVERRIDE; |
95 | 95 |
96 private: | 96 private: |
97 GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePM
Color); | 97 GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePM
Color); |
98 | 98 |
99 GrXferProcessor* onCreateXferProcessor(const GrProcOptInfo& colorPOI, | 99 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, |
| 100 const GrProcOptInfo& colorPOI, |
100 const GrProcOptInfo& coveragePOI, | 101 const GrProcOptInfo& coveragePOI, |
101 const GrDeviceCoordTexture* dstCopy)
const SK_OVERRIDE; | 102 const GrDeviceCoordTexture* dstCopy)
const SK_OVERRIDE; |
102 | 103 |
103 bool willReadDstColor(const GrProcOptInfo& colorPOI, | 104 bool willReadDstColor(const GrDrawTargetCaps& caps, |
| 105 const GrProcOptInfo& colorPOI, |
104 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE { | 106 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE { |
105 return true; | 107 return true; |
106 } | 108 } |
107 | 109 |
108 bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { | 110 bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { |
109 const GrArithmeticXPFactory& xpf = xpfBase.cast<GrArithmeticXPFactory>()
; | 111 const GrArithmeticXPFactory& xpf = xpfBase.cast<GrArithmeticXPFactory>()
; |
110 if (fK1 != xpf.fK1 || | 112 if (fK1 != xpf.fK1 || |
111 fK2 != xpf.fK2 || | 113 fK2 != xpf.fK2 || |
112 fK3 != xpf.fK3 || | 114 fK3 != xpf.fK3 || |
113 fK4 != xpf.fK4 || | 115 fK4 != xpf.fK4 || |
114 fEnforcePMColor != xpf.fEnforcePMColor) { | 116 fEnforcePMColor != xpf.fEnforcePMColor) { |
115 return false; | 117 return false; |
116 } | 118 } |
117 return true; | 119 return true; |
118 } | 120 } |
119 | 121 |
120 GR_DECLARE_XP_FACTORY_TEST; | 122 GR_DECLARE_XP_FACTORY_TEST; |
121 | 123 |
122 float fK1, fK2, fK3, fK4; | 124 float fK1, fK2, fK3, fK4; |
123 bool fEnforcePMColor; | 125 bool fEnforcePMColor; |
124 | 126 |
125 typedef GrXPFactory INHERITED; | 127 typedef GrXPFactory INHERITED; |
126 }; | 128 }; |
127 | 129 |
128 #endif | 130 #endif |
129 #endif | 131 #endif |
OLD | NEW |