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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 const SkColor* color){ | 933 const SkColor* color){ |
934 float a = SkColorGetA(*color) / 255.f; | 934 float a = SkColorGetA(*color) / 255.f; |
935 float aDiv255 = a / 255.f; | 935 float aDiv255 = a / 255.f; |
936 pdman.set4f(uni, | 936 pdman.set4f(uni, |
937 SkColorGetR(*color) * aDiv255, | 937 SkColorGetR(*color) * aDiv255, |
938 SkColorGetG(*color) * aDiv255, | 938 SkColorGetG(*color) * aDiv255, |
939 SkColorGetB(*color) * aDiv255, | 939 SkColorGetB(*color) * aDiv255, |
940 a); | 940 a); |
941 } | 941 } |
942 | 942 |
943 void GrGLGradientEffect::setData(const GrGLProgramDataManager& pdman, | 943 void GrGLGradientEffect::onSetData(const GrGLProgramDataManager& pdman, |
944 const GrProcessor& processor) { | 944 const GrProcessor& processor) { |
945 | 945 |
946 const GrGradientEffect& e = processor.cast<GrGradientEffect>(); | 946 const GrGradientEffect& e = processor.cast<GrGradientEffect>(); |
947 | 947 |
948 | 948 |
949 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()){ | 949 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()){ |
950 | 950 |
951 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { | 951 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { |
952 set_mul_color_uni(pdman, fColorStartUni, e.getColors(0)); | 952 set_mul_color_uni(pdman, fColorStartUni, e.getColors(0)); |
953 set_mul_color_uni(pdman, fColorEndUni, e.getColors(1)); | 953 set_mul_color_uni(pdman, fColorEndUni, e.getColors(1)); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 (*stops)[i] = stop; | 1178 (*stops)[i] = stop; |
1179 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; |
1180 } | 1180 } |
1181 } | 1181 } |
1182 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1182 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1183 | 1183 |
1184 return outColors; | 1184 return outColors; |
1185 } | 1185 } |
1186 | 1186 |
1187 #endif | 1187 #endif |
OLD | NEW |