| 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 | 1041 |
| 1042 uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) { | 1042 uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) { |
| 1043 const GrGradientEffect& e = processor.cast<GrGradientEffect>(); | 1043 const GrGradientEffect& e = processor.cast<GrGradientEffect>(); |
| 1044 | 1044 |
| 1045 uint32_t key = 0; | 1045 uint32_t key = 0; |
| 1046 | 1046 |
| 1047 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()) { | 1047 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()) { |
| 1048 key |= kTwoColorKey; | 1048 key |= kTwoColorKey; |
| 1049 } else if (SkGradientShaderBase::kThree_GpuColorType == e.getColorType()){ | 1049 } else if (SkGradientShaderBase::kThree_GpuColorType == e.getColorType()) { |
| 1050 key |= kThreeColorKey; | 1050 key |= kThreeColorKey; |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { | 1053 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { |
| 1054 key |= kPremulBeforeInterpKey; | 1054 key |= kPremulBeforeInterpKey; |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 return key; | 1057 return key; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 (*stops)[i] = stop; | 1235 (*stops)[i] = stop; |
| 1236 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1236 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
| 1237 } | 1237 } |
| 1238 } | 1238 } |
| 1239 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1239 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
| 1240 | 1240 |
| 1241 return outColors; | 1241 return outColors; |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 #endif | 1244 #endif |
| OLD | NEW |