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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 fsBuilder->appendTextureLookupAndModulate(inputColor, | 1051 fsBuilder->appendTextureLookupAndModulate(inputColor, |
1052 samplers[0], | 1052 samplers[0], |
1053 "coord"); | 1053 "coord"); |
1054 fsBuilder->codeAppend(";\n"); | 1054 fsBuilder->codeAppend(";\n"); |
1055 } | 1055 } |
1056 } | 1056 } |
1057 | 1057 |
1058 ///////////////////////////////////////////////////////////////////// | 1058 ///////////////////////////////////////////////////////////////////// |
1059 | 1059 |
1060 GrGradientEffect::GrGradientEffect(GrContext* ctx, | 1060 GrGradientEffect::GrGradientEffect(GrContext* ctx, |
1061 GrProcessorDataManager*, | |
1062 const SkGradientShaderBase& shader, | 1061 const SkGradientShaderBase& shader, |
1063 const SkMatrix& matrix, | 1062 const SkMatrix& matrix, |
1064 SkShader::TileMode tileMode) { | 1063 SkShader::TileMode tileMode) { |
1065 | 1064 |
1066 fIsOpaque = shader.isOpaque(); | 1065 fIsOpaque = shader.isOpaque(); |
1067 | 1066 |
1068 fColorType = shader.getGpuColorType(&fColors[0]); | 1067 fColorType = shader.getGpuColorType(&fColors[0]); |
1069 | 1068 |
1070 // The two and three color specializations do not currently support tiling. | 1069 // The two and three color specializations do not currently support tiling. |
1071 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType || | 1070 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType || |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 (*stops)[i] = stop; | 1177 (*stops)[i] = stop; |
1179 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1178 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
1180 } | 1179 } |
1181 } | 1180 } |
1182 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1181 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1183 | 1182 |
1184 return outColors; | 1183 return outColors; |
1185 } | 1184 } |
1186 | 1185 |
1187 #endif | 1186 #endif |
OLD | NEW |