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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { | 80 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 84 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
85 GrXPFactory::InvariantOutput*) const override; | 85 GrXPFactory::InvariantOutput*) const override; |
86 | 86 |
87 private: | 87 private: |
88 GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePM
Color); | 88 GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePM
Color); |
89 | 89 |
90 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, | 90 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
91 const GrProcOptInfo& colorPOI, | 91 const GrProcOptInfo& colorPOI, |
92 const GrProcOptInfo& coveragePOI, | 92 const GrProcOptInfo& coveragePOI, |
93 const GrDeviceCoordTexture* dstCopy)
const override; | 93 const GrDeviceCoordTexture* dstCopy)
const override; |
94 | 94 |
95 bool willReadDstColor(const GrDrawTargetCaps& caps, | 95 bool willReadDstColor(const GrCaps& caps, |
96 const GrProcOptInfo& colorPOI, | 96 const GrProcOptInfo& colorPOI, |
97 const GrProcOptInfo& coveragePOI) const override { | 97 const GrProcOptInfo& coveragePOI) const override { |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 bool onIsEqual(const GrXPFactory& xpfBase) const override { | 101 bool onIsEqual(const GrXPFactory& xpfBase) const override { |
102 const GrArithmeticXPFactory& xpf = xpfBase.cast<GrArithmeticXPFactory>()
; | 102 const GrArithmeticXPFactory& xpf = xpfBase.cast<GrArithmeticXPFactory>()
; |
103 if (fK1 != xpf.fK1 || | 103 if (fK1 != xpf.fK1 || |
104 fK2 != xpf.fK2 || | 104 fK2 != xpf.fK2 || |
105 fK3 != xpf.fK3 || | 105 fK3 != xpf.fK3 || |
106 fK4 != xpf.fK4 || | 106 fK4 != xpf.fK4 || |
107 fEnforcePMColor != xpf.fEnforcePMColor) { | 107 fEnforcePMColor != xpf.fEnforcePMColor) { |
108 return false; | 108 return false; |
109 } | 109 } |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 GR_DECLARE_XP_FACTORY_TEST; | 113 GR_DECLARE_XP_FACTORY_TEST; |
114 | 114 |
115 float fK1, fK2, fK3, fK4; | 115 float fK1, fK2, fK3, fK4; |
116 bool fEnforcePMColor; | 116 bool fEnforcePMColor; |
117 | 117 |
118 typedef GrXPFactory INHERITED; | 118 typedef GrXPFactory INHERITED; |
119 }; | 119 }; |
120 | 120 |
121 #endif | 121 #endif |
122 #endif | 122 #endif |
OLD | NEW |