| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrConfigConversionEffect.h" | 8 #include "GrConfigConversionEffect.h" |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrTBackendEffectFactory.h" | 10 #include "GrTBackendEffectFactory.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, | 125 void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, |
| 126 uint32_t* validFlags)
const { | 126 uint32_t* validFlags)
const { |
| 127 this->updateConstantColorComponentsForModulation(color, validFlags); | 127 this->updateConstantColorComponentsForModulation(color, validFlags); |
| 128 } | 128 } |
| 129 | 129 |
| 130 /////////////////////////////////////////////////////////////////////////////// | 130 /////////////////////////////////////////////////////////////////////////////// |
| 131 | 131 |
| 132 GR_DEFINE_EFFECT_TEST(GrConfigConversionEffect); | 132 GR_DEFINE_EFFECT_TEST(GrConfigConversionEffect); |
| 133 | 133 |
| 134 GrEffectRef* GrConfigConversionEffect::TestCreate(SkMWCRandom* random, | 134 GrEffectRef* GrConfigConversionEffect::TestCreate(SkMWCRandom* random, |
| 135 GrContext* context, | 135 GrContext*, |
| 136 GrTexture* textures[]) { | 136 GrTexture* textures[]) { |
| 137 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); | 137 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); |
| 138 bool swapRB; | 138 bool swapRB; |
| 139 if (kNone_PMConversion == pmConv) { | 139 if (kNone_PMConversion == pmConv) { |
| 140 swapRB = true; | 140 swapRB = true; |
| 141 } else { | 141 } else { |
| 142 swapRB = random->nextBool(); | 142 swapRB = random->nextBool(); |
| 143 } | 143 } |
| 144 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, | 144 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, |
| 145 (textures[GrEffectUnitTest::kSkiaPMTexture
Idx], | 145 (textures[GrEffectUnitTest::kSkiaPMTexture
Idx], |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // The PM conversions assume colors are 0..255 | 277 // The PM conversions assume colors are 0..255 |
| 278 return NULL; | 278 return NULL; |
| 279 } | 279 } |
| 280 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, (texture, | 280 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, (texture, |
| 281 swapRedAndB
lue, | 281 swapRedAndB
lue, |
| 282 pmConversio
n, | 282 pmConversio
n, |
| 283 matrix))); | 283 matrix))); |
| 284 return CreateEffectRef(effect); | 284 return CreateEffectRef(effect); |
| 285 } | 285 } |
| 286 } | 286 } |
| OLD | NEW |