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