| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->fTextures[GrProcessorUnitTest::kSkiaP
MTextureIdx], | 139 return new GrConfigConversionEffect(d->fTextures[GrProcessorUnitTest::kSkiaP
MTextureIdx], |
| 140 swapRB, pmConv, GrTest::TestMatrix(d->fR
andom)); | 140 swapRB, pmConv, GrTest::TestMatrix(d->fR
andom)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 /////////////////////////////////////////////////////////////////////////////// | 143 /////////////////////////////////////////////////////////////////////////////// |
| 144 | 144 |
| 145 void GrConfigConversionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, | 145 void GrConfigConversionEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
| 146 GrProcessorKeyBuilder* b) con
st { | 146 GrProcessorKeyBuilder* b) c
onst { |
| 147 GrGLConfigConversionEffect::GenKey(*this, caps, b); | 147 GrGLConfigConversionEffect::GenKey(*this, caps, b); |
| 148 } | 148 } |
| 149 | 149 |
| 150 GrGLSLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const { | 150 GrGLSLFragmentProcessor* GrConfigConversionEffect::onCreateGLSLInstance() const
{ |
| 151 return new GrGLConfigConversionEffect(*this); | 151 return new GrGLConfigConversionEffect(*this); |
| 152 } | 152 } |
| 153 | 153 |
| 154 | 154 |
| 155 | 155 |
| 156 void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
, | 156 void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
, |
| 157 PMConversion* pmTo
UPMRule, | 157 PMConversion* pmTo
UPMRule, |
| 158 PMConversion* upmT
oPMRule) { | 158 PMConversion* upmT
oPMRule) { |
| 159 *pmToUPMRule = kNone_PMConversion; | 159 *pmToUPMRule = kNone_PMConversion; |
| 160 *upmToPMRule = kNone_PMConversion; | 160 *upmToPMRule = kNone_PMConversion; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } else { | 298 } else { |
| 299 if (kRGBA_8888_GrPixelConfig != texture->config() && | 299 if (kRGBA_8888_GrPixelConfig != texture->config() && |
| 300 kBGRA_8888_GrPixelConfig != texture->config() && | 300 kBGRA_8888_GrPixelConfig != texture->config() && |
| 301 kNone_PMConversion != pmConversion) { | 301 kNone_PMConversion != pmConversion) { |
| 302 // The PM conversions assume colors are 0..255 | 302 // The PM conversions assume colors are 0..255 |
| 303 return nullptr; | 303 return nullptr; |
| 304 } | 304 } |
| 305 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio
n, matrix); | 305 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio
n, matrix); |
| 306 } | 306 } |
| 307 } | 307 } |
| OLD | NEW |