| 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 "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 void GrConfigConversionEffect::onComputeInvariantOutput(GrInvariantOutput* inout
) const { | 123 void GrConfigConversionEffect::onComputeInvariantOutput(GrInvariantOutput* inout
) const { |
| 124 this->updateInvariantOutputForModulation(inout); | 124 this->updateInvariantOutputForModulation(inout); |
| 125 } | 125 } |
| 126 | 126 |
| 127 /////////////////////////////////////////////////////////////////////////////// | 127 /////////////////////////////////////////////////////////////////////////////// |
| 128 | 128 |
| 129 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); | 129 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect); |
| 130 | 130 |
| 131 GrFragmentProcessor* GrConfigConversionEffect::TestCreate(GrProcessorTestData* d
) { | 131 const GrFragmentProcessor* GrConfigConversionEffect::TestCreate(GrProcessorTestD
ata* d) { |
| 132 PMConversion pmConv = static_cast<PMConversion>(d->fRandom->nextULessThan(kP
MConversionCnt)); | 132 PMConversion pmConv = static_cast<PMConversion>(d->fRandom->nextULessThan(kP
MConversionCnt)); |
| 133 bool swapRB; | 133 bool swapRB; |
| 134 if (kNone_PMConversion == pmConv) { | 134 if (kNone_PMConversion == pmConv) { |
| 135 swapRB = true; | 135 swapRB = true; |
| 136 } else { | 136 } else { |
| 137 swapRB = d->fRandom->nextBool(); | 137 swapRB = d->fRandom->nextBool(); |
| 138 } | 138 } |
| 139 return new GrConfigConversionEffect(d->fProcDataManager, | 139 return new GrConfigConversionEffect(d->fProcDataManager, |
| 140 d->fTextures[GrProcessorUnitTest::kSkiaP
MTextureIdx], | 140 d->fTextures[GrProcessorUnitTest::kSkiaP
MTextureIdx], |
| 141 swapRB, pmConv, GrTest::TestMatrix(d->fR
andom)); | 141 swapRB, pmConv, GrTest::TestMatrix(d->fR
andom)); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (kRGBA_8888_GrPixelConfig != texture->config() && | 302 if (kRGBA_8888_GrPixelConfig != texture->config() && |
| 303 kBGRA_8888_GrPixelConfig != texture->config() && | 303 kBGRA_8888_GrPixelConfig != texture->config() && |
| 304 kNone_PMConversion != pmConversion) { | 304 kNone_PMConversion != pmConversion) { |
| 305 // The PM conversions assume colors are 0..255 | 305 // The PM conversions assume colors are 0..255 |
| 306 return nullptr; | 306 return nullptr; |
| 307 } | 307 } |
| 308 return new GrConfigConversionEffect(procDataManager, texture, swapRedAnd
Blue, pmConversion, | 308 return new GrConfigConversionEffect(procDataManager, texture, swapRedAnd
Blue, pmConversion, |
| 309 matrix); | 309 matrix); |
| 310 } | 310 } |
| 311 } | 311 } |
| OLD | NEW |