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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 } | 850 } |
851 | 851 |
852 GrGLEffect::EffectKey GrGLGradientEffect::GenMatrixKey(const GrDrawEffect& drawE
ffect) { | 852 GrGLEffect::EffectKey GrGLGradientEffect::GenMatrixKey(const GrDrawEffect& drawE
ffect) { |
853 const GrGradientEffect& e = drawEffect.castEffect<GrGradientEffect>(); | 853 const GrGradientEffect& e = drawEffect.castEffect<GrGradientEffect>(); |
854 const GrTexture* texture = e.texture(0); | 854 const GrTexture* texture = e.texture(0); |
855 return GrGLEffectMatrix::GenKey(e.getMatrix(), drawEffect, kCoordsType, text
ure); | 855 return GrGLEffectMatrix::GenKey(e.getMatrix(), drawEffect, kCoordsType, text
ure); |
856 } | 856 } |
857 | 857 |
858 void GrGLGradientEffect::setupMatrix(GrGLShaderBuilder* builder, | 858 void GrGLGradientEffect::setupMatrix(GrGLShaderBuilder* builder, |
859 EffectKey key, | 859 EffectKey key, |
860 const char** fsCoordName, | 860 SkString* fsCoordName, |
861 const char** vsVaryingName, | 861 SkString* vsVaryingName, |
862 GrSLType* vsVaryingType) { | 862 GrSLType* vsVaryingType) { |
863 fEffectMatrix.emitCodeMakeFSCoords2D(builder, | 863 fEffectMatrix.emitCodeMakeFSCoords2D(builder, |
864 key & kMatrixKeyMask, | 864 key & kMatrixKeyMask, |
865 fsCoordName, | 865 fsCoordName, |
866 vsVaryingName, | 866 vsVaryingName, |
867 vsVaryingType); | 867 vsVaryingType); |
868 } | 868 } |
869 | 869 |
870 void GrGLGradientEffect::emitColorLookup(GrGLShaderBuilder* builder, | 870 void GrGLGradientEffect::emitColorLookup(GrGLShaderBuilder* builder, |
871 const char* gradientTValue, | 871 const char* gradientTValue, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 (*stops)[i] = stop; | 976 (*stops)[i] = stop; |
977 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 977 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
978 } | 978 } |
979 } | 979 } |
980 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 980 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
981 | 981 |
982 return outColors; | 982 return outColors; |
983 } | 983 } |
984 | 984 |
985 #endif | 985 #endif |
OLD | NEW |