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 11 matching lines...) Expand all Loading... |
22 fPMConversion = configConversionEffect.pmConversion(); | 22 fPMConversion = configConversionEffect.pmConversion(); |
23 } | 23 } |
24 | 24 |
25 virtual void emitCode(GrGLFPBuilder* builder, | 25 virtual void emitCode(GrGLFPBuilder* builder, |
26 const GrFragmentProcessor&, | 26 const GrFragmentProcessor&, |
27 const char* outputColor, | 27 const char* outputColor, |
28 const char* inputColor, | 28 const char* inputColor, |
29 const TransformedCoordsArray& coords, | 29 const TransformedCoordsArray& coords, |
30 const TextureSamplerArray& samplers) SK_OVERRIDE { | 30 const TextureSamplerArray& samplers) SK_OVERRIDE { |
31 // Using highp for GLES here in order to avoid some precision issues on
specific GPUs. | 31 // Using highp for GLES here in order to avoid some precision issues on
specific GPUs. |
32 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, GrGLShaderVar::kHig
h_Precision); | 32 GrGLShaderVar tmpVar("tmpColor", kVec4f_GrSLType, 0, kHigh_GrSLPrecision
); |
33 SkString tmpDecl; | 33 SkString tmpDecl; |
34 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl); | 34 tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl); |
35 | 35 |
36 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 36 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
37 | 37 |
38 fsBuilder->codeAppendf("%s;", tmpDecl.c_str()); | 38 fsBuilder->codeAppendf("%s;", tmpDecl.c_str()); |
39 | 39 |
40 fsBuilder->codeAppendf("%s = ", tmpVar.c_str()); | 40 fsBuilder->codeAppendf("%s = ", tmpVar.c_str()); |
41 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0]
.getType()); | 41 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0]
.getType()); |
42 fsBuilder->codeAppend(";"); | 42 fsBuilder->codeAppend(";"); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 kNone_PMConversion != pmConversion) { | 278 kNone_PMConversion != pmConversion) { |
279 // The PM conversions assume colors are 0..255 | 279 // The PM conversions assume colors are 0..255 |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, | 282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, |
283 swapRedAndBlue, | 283 swapRedAndBlue, |
284 pmConversion, | 284 pmConversion, |
285 matrix)); | 285 matrix)); |
286 } | 286 } |
287 } | 287 } |
OLD | NEW |