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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 fEnforcePMColor == fp.fEnforcePMColor; | 130 fEnforcePMColor == fp.fEnforcePMColor; |
131 } | 131 } |
132 | 132 |
133 void GrArithmeticFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 133 void GrArithmeticFP::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
134 // TODO: optimize this | 134 // TODO: optimize this |
135 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); | 135 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
136 } | 136 } |
137 | 137 |
138 /////////////////////////////////////////////////////////////////////////////// | 138 /////////////////////////////////////////////////////////////////////////////// |
139 | 139 |
140 const GrFragmentProcessor* GrArithmeticFP::TestCreate(GrProcessorTestData* d) { | 140 GrFragmentProcessor* GrArithmeticFP::TestCreate(GrProcessorTestData* d) { |
141 float k1 = d->fRandom->nextF(); | 141 float k1 = d->fRandom->nextF(); |
142 float k2 = d->fRandom->nextF(); | 142 float k2 = d->fRandom->nextF(); |
143 float k3 = d->fRandom->nextF(); | 143 float k3 = d->fRandom->nextF(); |
144 float k4 = d->fRandom->nextF(); | 144 float k4 = d->fRandom->nextF(); |
145 bool enforcePMColor = d->fRandom->nextBool(); | 145 bool enforcePMColor = d->fRandom->nextBool(); |
146 | 146 |
147 return new GrArithmeticFP(d->fProcDataManager, k1, k2, k3, k4, enforcePMColo
r, d->fTextures[0]); | 147 return new GrArithmeticFP(d->fProcDataManager, k1, k2, k3, k4, enforcePMColo
r, d->fTextures[0]); |
148 } | 148 } |
149 | 149 |
150 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP); | 150 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 blendedColor->fWillBlendWithDst = true; | 288 blendedColor->fWillBlendWithDst = true; |
289 | 289 |
290 // TODO: We could try to optimize this more. For example if fK1 and fK3 are
zero, then we won't | 290 // TODO: We could try to optimize this more. For example if fK1 and fK3 are
zero, then we won't |
291 // be blending the color with dst at all so we can know what the output colo
r is (up to the | 291 // be blending the color with dst at all so we can know what the output colo
r is (up to the |
292 // valid color components passed in). | 292 // valid color components passed in). |
293 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; | 293 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
294 } | 294 } |
295 | 295 |
296 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); | 296 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); |
297 | 297 |
298 const GrXPFactory* GrArithmeticXPFactory::TestCreate(GrProcessorTestData* d) { | 298 GrXPFactory* GrArithmeticXPFactory::TestCreate(GrProcessorTestData* d) { |
299 float k1 = d->fRandom->nextF(); | 299 float k1 = d->fRandom->nextF(); |
300 float k2 = d->fRandom->nextF(); | 300 float k2 = d->fRandom->nextF(); |
301 float k3 = d->fRandom->nextF(); | 301 float k3 = d->fRandom->nextF(); |
302 float k4 = d->fRandom->nextF(); | 302 float k4 = d->fRandom->nextF(); |
303 bool enforcePMColor = d->fRandom->nextBool(); | 303 bool enforcePMColor = d->fRandom->nextBool(); |
304 | 304 |
305 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); | 305 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); |
306 } | 306 } |
307 | 307 |
308 #endif | 308 #endif |
OLD | NEW |