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 #include "SkArithmeticMode_gpu.h" | 8 #include "SkArithmeticMode_gpu.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 float k1() const { return fK1; } | 163 float k1() const { return fK1; } |
164 float k2() const { return fK2; } | 164 float k2() const { return fK2; } |
165 float k3() const { return fK3; } | 165 float k3() const { return fK3; } |
166 float k4() const { return fK4; } | 166 float k4() const { return fK4; } |
167 bool enforcePMColor() const { return fEnforcePMColor; } | 167 bool enforcePMColor() const { return fEnforcePMColor; } |
168 | 168 |
169 private: | 169 private: |
170 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&
optimizations, | 170 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&
optimizations, |
171 bool doesStencilWrite, | 171 bool doesStencilWrite, |
172 GrColor* overrideColor, | 172 GrColor* overrideColor, |
173 const GrCaps& caps) override; | 173 const GrCaps& caps) const overr
ide; |
174 | 174 |
175 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; | 175 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; |
176 | 176 |
177 bool onIsEqual(const GrXferProcessor& xpBase) const override { | 177 bool onIsEqual(const GrXferProcessor& xpBase) const override { |
178 const ArithmeticXP& xp = xpBase.cast<ArithmeticXP>(); | 178 const ArithmeticXP& xp = xpBase.cast<ArithmeticXP>(); |
179 if (fK1 != xp.fK1 || | 179 if (fK1 != xp.fK1 || |
180 fK2 != xp.fK2 || | 180 fK2 != xp.fK2 || |
181 fK3 != xp.fK3 || | 181 fK3 != xp.fK3 || |
182 fK4 != xp.fK4 || | 182 fK4 != xp.fK4 || |
183 fEnforcePMColor != xp.fEnforcePMColor) { | 183 fEnforcePMColor != xp.fEnforcePMColor) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void ArithmeticXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
uilder* b) const { | 253 void ArithmeticXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
uilder* b) const { |
254 GLArithmeticXP::GenKey(*this, caps, b); | 254 GLArithmeticXP::GenKey(*this, caps, b); |
255 } | 255 } |
256 | 256 |
257 GrGLSLXferProcessor* ArithmeticXP::createGLSLInstance() const { return new GLAri
thmeticXP(*this); } | 257 GrGLSLXferProcessor* ArithmeticXP::createGLSLInstance() const { return new GLAri
thmeticXP(*this); } |
258 | 258 |
259 GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations( | 259 GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations( |
260 const GrPipelineOptimizat
ions& optimizations, | 260 const GrPipelineOptimizat
ions& optimizations, |
261 bool doesStencilWrite, | 261 bool doesStencilWrite, |
262 GrColor* overrideColor, | 262 GrColor* overrideColor, |
263 const GrCaps& caps) { | 263 const GrCaps& caps) const
{ |
264 return GrXferProcessor::kNone_OptFlags; | 264 return GrXferProcessor::kNone_OptFlags; |
265 } | 265 } |
266 | 266 |
267 /////////////////////////////////////////////////////////////////////////////// | 267 /////////////////////////////////////////////////////////////////////////////// |
268 | 268 |
269 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float
k4, | 269 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float
k4, |
270 bool enforcePMColor) | 270 bool enforcePMColor) |
271 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { | 271 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { |
272 this->initClassID<GrArithmeticXPFactory>(); | 272 this->initClassID<GrArithmeticXPFactory>(); |
273 } | 273 } |
(...skipping 23 matching lines...) Expand all Loading... |
297 float k1 = d->fRandom->nextF(); | 297 float k1 = d->fRandom->nextF(); |
298 float k2 = d->fRandom->nextF(); | 298 float k2 = d->fRandom->nextF(); |
299 float k3 = d->fRandom->nextF(); | 299 float k3 = d->fRandom->nextF(); |
300 float k4 = d->fRandom->nextF(); | 300 float k4 = d->fRandom->nextF(); |
301 bool enforcePMColor = d->fRandom->nextBool(); | 301 bool enforcePMColor = d->fRandom->nextBool(); |
302 | 302 |
303 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); | 303 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); |
304 } | 304 } |
305 | 305 |
306 #endif | 306 #endif |
OLD | NEW |