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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Why did we pollute our texture cache instead of using a GrSingleTextureEf
fect? | 114 // Why did we pollute our texture cache instead of using a GrSingleTextureEf
fect? |
115 SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion); | 115 SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion); |
116 } | 116 } |
117 | 117 |
118 const GrBackendFragmentProcessorFactory& GrConfigConversionEffect::getFactory()
const { | 118 const GrBackendFragmentProcessorFactory& GrConfigConversionEffect::getFactory()
const { |
119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst
ance(); | 119 return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInst
ance(); |
120 } | 120 } |
121 | 121 |
122 bool GrConfigConversionEffect::onIsEqual(const GrFragmentProcessor& s) const { | 122 bool GrConfigConversionEffect::onIsEqual(const GrFragmentProcessor& 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 other.fSwapRedAndBlue == fSwapRedAndBlue && |
125 other.fSwapRedAndBlue == fSwapRedAndBlue && | |
126 other.fPMConversion == fPMConversion; | 125 other.fPMConversion == fPMConversion; |
127 } | 126 } |
128 | 127 |
129 void GrConfigConversionEffect::onComputeInvariantOutput(InvariantOutput* inout)
const { | 128 void GrConfigConversionEffect::onComputeInvariantOutput(InvariantOutput* inout)
const { |
130 this->updateInvariantOutputForModulation(inout); | 129 this->updateInvariantOutputForModulation(inout); |
131 } | 130 } |
132 | 131 |
133 /////////////////////////////////////////////////////////////////////////////// | 132 /////////////////////////////////////////////////////////////////////////////// |
134 | 133 |
135 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); | 134 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 kNone_PMConversion != pmConversion) { | 274 kNone_PMConversion != pmConversion) { |
276 // The PM conversions assume colors are 0..255 | 275 // The PM conversions assume colors are 0..255 |
277 return NULL; | 276 return NULL; |
278 } | 277 } |
279 return SkNEW_ARGS(GrConfigConversionEffect, (texture, | 278 return SkNEW_ARGS(GrConfigConversionEffect, (texture, |
280 swapRedAndBlue, | 279 swapRedAndBlue, |
281 pmConversion, | 280 pmConversion, |
282 matrix)); | 281 matrix)); |
283 } | 282 } |
284 } | 283 } |
OLD | NEW |