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 "GrTBackendProcessorFactory.h" | 10 #include "GrTBackendProcessorFactory.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst
ance(); | 119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst
ance(); |
120 } | 120 } |
121 | 121 |
122 bool GrConfigConversionEffect::onIsEqual(const GrProcessor& s) const { | 122 bool GrConfigConversionEffect::onIsEqual(const GrProcessor& s) const { |
123 const GrConfigConversionEffect& other = s.cast<GrConfigConversionEffect>(); | 123 const GrConfigConversionEffect& other = s.cast<GrConfigConversionEffect>(); |
124 return this->texture(0) == s.texture(0) && | 124 return this->texture(0) == s.texture(0) && |
125 other.fSwapRedAndBlue == fSwapRedAndBlue && | 125 other.fSwapRedAndBlue == fSwapRedAndBlue && |
126 other.fPMConversion == fPMConversion; | 126 other.fPMConversion == fPMConversion; |
127 } | 127 } |
128 | 128 |
129 void GrConfigConversionEffect::onComputeInvariantOutput(InvariantOutput* inout)
const { | 129 void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, |
130 this->updateInvariantOutputForModulation(inout); | 130 uint32_t* validFlags)
const { |
131 inout->fIsSingleComponent = false; | 131 this->updateConstantColorComponentsForModulation(color, validFlags); |
132 } | 132 } |
133 | 133 |
134 /////////////////////////////////////////////////////////////////////////////// | 134 /////////////////////////////////////////////////////////////////////////////// |
135 | 135 |
136 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); | 136 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); |
137 | 137 |
138 GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random, | 138 GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random, |
139 GrContext*, | 139 GrContext*, |
140 const GrDrawTargetCaps
&, | 140 const GrDrawTargetCaps
&, |
141 GrTexture* textures[])
{ | 141 GrTexture* textures[])
{ |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 kNone_PMConversion != pmConversion) { | 276 kNone_PMConversion != pmConversion) { |
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 return SkNEW_ARGS(GrConfigConversionEffect, (texture, | 280 return SkNEW_ARGS(GrConfigConversionEffect, (texture, |
281 swapRedAndBlue, | 281 swapRedAndBlue, |
282 pmConversion, | 282 pmConversion, |
283 matrix)); | 283 matrix)); |
284 } | 284 } |
285 } | 285 } |
OLD | NEW |