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 "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void GrConfigConversionEffect::onComputeInvariantOutput(GrInvariantOutput* inout
) const { | 122 void GrConfigConversionEffect::onComputeInvariantOutput(GrInvariantOutput* inout
) const { |
123 this->updateInvariantOutputForModulation(inout); | 123 this->updateInvariantOutputForModulation(inout); |
124 } | 124 } |
125 | 125 |
126 /////////////////////////////////////////////////////////////////////////////// | 126 /////////////////////////////////////////////////////////////////////////////// |
127 | 127 |
128 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); | 128 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); |
129 | 129 |
130 GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random, | 130 GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random, |
131 GrContext*, | 131 GrContext*, |
132 const GrDrawTargetCaps
&, | 132 const GrCaps&, |
133 GrTexture* textures[])
{ | 133 GrTexture* textures[])
{ |
134 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); | 134 PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMCon
versionCnt)); |
135 bool swapRB; | 135 bool swapRB; |
136 if (kNone_PMConversion == pmConv) { | 136 if (kNone_PMConversion == pmConv) { |
137 swapRB = true; | 137 swapRB = true; |
138 } else { | 138 } else { |
139 swapRB = random->nextBool(); | 139 swapRB = random->nextBool(); |
140 } | 140 } |
141 return SkNEW_ARGS(GrConfigConversionEffect, | 141 return SkNEW_ARGS(GrConfigConversionEffect, |
142 (textures[GrProcessorUnitTest::kSkiaPMText
ureIdx], | 142 (textures[GrProcessorUnitTest::kSkiaPMText
ureIdx], |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 kNone_PMConversion != pmConversion) { | 289 kNone_PMConversion != pmConversion) { |
290 // The PM conversions assume colors are 0..255 | 290 // The PM conversions assume colors are 0..255 |
291 return NULL; | 291 return NULL; |
292 } | 292 } |
293 return SkNEW_ARGS(GrConfigConversionEffect, (texture, | 293 return SkNEW_ARGS(GrConfigConversionEffect, (texture, |
294 swapRedAndBlue, | 294 swapRedAndBlue, |
295 pmConversion, | 295 pmConversion, |
296 matrix)); | 296 matrix)); |
297 } | 297 } |
298 } | 298 } |
OLD | NEW |