| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkGradientShaderPriv.h" | 8 #include "SkGradientShaderPriv.h" |
| 9 #include "SkLinearGradient.h" | 9 #include "SkLinearGradient.h" |
| 10 #include "SkRadialGradient.h" | 10 #include "SkRadialGradient.h" |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 key |= kThreeColorKey; | 1013 key |= kThreeColorKey; |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { | 1016 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { |
| 1017 key |= kPremulBeforeInterpKey; | 1017 key |= kPremulBeforeInterpKey; |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 return key; | 1020 return key; |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 void GrGLGradientEffect::emitColor(GrGLSLFragmentBuilder* fragBuilder, | 1023 void GrGLGradientEffect::emitColor(GrGLSLFPFragmentBuilder* fragBuilder, |
| 1024 GrGLSLUniformHandler* uniformHandler, | 1024 GrGLSLUniformHandler* uniformHandler, |
| 1025 const GrGLSLCaps* glslCaps, | 1025 const GrGLSLCaps* glslCaps, |
| 1026 const GrGradientEffect& ge, | 1026 const GrGradientEffect& ge, |
| 1027 const char* gradientTValue, | 1027 const char* gradientTValue, |
| 1028 const char* outputColor, | 1028 const char* outputColor, |
| 1029 const char* inputColor, | 1029 const char* inputColor, |
| 1030 const TextureSamplerArray& samplers) { | 1030 const TextureSamplerArray& samplers) { |
| 1031 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){ | 1031 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){ |
| 1032 fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0,
1.0));\n", | 1032 fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0,
1.0));\n", |
| 1033 uniformHandler->getUniformVariable(fColorStartU
ni).c_str(), | 1033 uniformHandler->getUniformVariable(fColorStartU
ni).c_str(), |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 (*stops)[i] = stop; | 1203 (*stops)[i] = stop; |
| 1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
| 1205 } | 1205 } |
| 1206 } | 1206 } |
| 1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
| 1208 | 1208 |
| 1209 return outColors; | 1209 return outColors; |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 #endif | 1212 #endif |
| OLD | NEW |