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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, | 128 void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, |
129 uint32_t* validFlags)
const { | 129 uint32_t* validFlags)
const { |
130 this->updateConstantColorComponentsForModulation(color, validFlags); | 130 this->updateConstantColorComponentsForModulation(color, validFlags); |
131 } | 131 } |
132 | 132 |
133 /////////////////////////////////////////////////////////////////////////////// | 133 /////////////////////////////////////////////////////////////////////////////// |
134 | 134 |
135 GR_DEFINE_EFFECT_TEST(GrConfigConversionEffect); | 135 GR_DEFINE_EFFECT_TEST(GrConfigConversionEffect); |
136 | 136 |
137 GrEffectRef* GrConfigConversionEffect::TestCreate(SkMWCRandom* random, | 137 GrEffectRef* GrConfigConversionEffect::TestCreate(SkRandom* random, |
138 GrContext*, | 138 GrContext*, |
139 const GrDrawTargetCaps&, | 139 const GrDrawTargetCaps&, |
140 GrTexture* textures[]) { | 140 GrTexture* textures[]) { |
141 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); | 141 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); |
142 bool swapRB; | 142 bool swapRB; |
143 if (kNone_PMConversion == pmConv) { | 143 if (kNone_PMConversion == pmConv) { |
144 swapRB = true; | 144 swapRB = true; |
145 } else { | 145 } else { |
146 swapRB = random->nextBool(); | 146 swapRB = random->nextBool(); |
147 } | 147 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // The PM conversions assume colors are 0..255 | 284 // The PM conversions assume colors are 0..255 |
285 return NULL; | 285 return NULL; |
286 } | 286 } |
287 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, (texture, | 287 AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, (texture, |
288 swapRedAndB
lue, | 288 swapRedAndB
lue, |
289 pmConversio
n, | 289 pmConversio
n, |
290 matrix))); | 290 matrix))); |
291 return CreateEffectRef(effect); | 291 return CreateEffectRef(effect); |
292 } | 292 } |
293 } | 293 } |
OLD | NEW |