| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 GrColor* overrideColo
r, | 231 GrColor* overrideColo
r, |
| 232 const GrDrawTargetCap
s& caps) { | 232 const GrDrawTargetCap
s& caps) { |
| 233 return GrXferProcessor::kNone_Opt; | 233 return GrXferProcessor::kNone_Opt; |
| 234 } | 234 } |
| 235 | 235 |
| 236 /////////////////////////////////////////////////////////////////////////////// | 236 /////////////////////////////////////////////////////////////////////////////// |
| 237 | 237 |
| 238 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float
k4, | 238 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float
k4, |
| 239 bool enforcePMColor) | 239 bool enforcePMColor) |
| 240 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { | 240 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { |
| 241 this->initClassID<GrArithmeticXPFactory>(); | 241 this->initClassID<GrArithmeticXPFactory>(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, | 244 void GrArithmeticXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, |
| 245 const GrProcOptInfo& coveragePOI, | 245 const GrProcOptInfo& coveragePOI, |
| 246 GrXPFactory::InvariantOutput* out
put) const { | 246 GrXPFactory::InvariantOutput* out
put) const { |
| 247 output->fWillBlendWithDst = true; | 247 output->fWillBlendWithDst = true; |
| 248 | 248 |
| 249 // TODO: We could try to optimize this more. For example if we have solid co
verage and fK1 and | 249 // TODO: We could try to optimize this more. For example if we have solid co
verage and fK1 and |
| 250 // fK3 are zero, then we won't be blending the color with dst at all so we c
an know what the | 250 // fK3 are zero, then we won't be blending the color with dst at all so we c
an know what the |
| 251 // output color is (up to the valid color components passed in). | 251 // output color is (up to the valid color components passed in). |
| 252 output->fBlendedColorFlags = 0; | 252 output->fBlendedColorFlags = 0; |
| 253 } | 253 } |
| 254 | 254 |
| 255 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); | 255 GR_DEFINE_XP_FACTORY_TEST(GrArithmeticXPFactory); |
| 256 | 256 |
| 257 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random, | 257 GrXPFactory* GrArithmeticXPFactory::TestCreate(SkRandom* random, |
| 258 GrContext*, | 258 GrContext*, |
| 259 const GrDrawTargetCaps&, | 259 const GrDrawTargetCaps&, |
| 260 GrTexture*[]) { | 260 GrTexture*[]) { |
| 261 float k1 = random->nextF(); | 261 float k1 = random->nextF(); |
| 262 float k2 = random->nextF(); | 262 float k2 = random->nextF(); |
| 263 float k3 = random->nextF(); | 263 float k3 = random->nextF(); |
| 264 float k4 = random->nextF(); | 264 float k4 = random->nextF(); |
| 265 bool enforcePMColor = random->nextBool(); | 265 bool enforcePMColor = random->nextBool(); |
| 266 | 266 |
| 267 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); | 267 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); |
| 268 } | 268 } |
| 269 | 269 |
| 270 #endif | 270 #endif |
| OLD | NEW |