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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 819 |
820 #if SK_SUPPORT_GPU | 820 #if SK_SUPPORT_GPU |
821 | 821 |
822 #include "effects/GrTextureStripAtlas.h" | 822 #include "effects/GrTextureStripAtlas.h" |
823 #include "GrTBackendEffectFactory.h" | 823 #include "GrTBackendEffectFactory.h" |
824 #include "SkGr.h" | 824 #include "SkGr.h" |
825 | 825 |
826 GrGLGradientEffect::GrGLGradientEffect(const GrBackendEffectFactory& factory) | 826 GrGLGradientEffect::GrGLGradientEffect(const GrBackendEffectFactory& factory) |
827 : INHERITED(factory) | 827 : INHERITED(factory) |
828 , fCachedYCoord(SK_ScalarMax) | 828 , fCachedYCoord(SK_ScalarMax) |
829 , fFSYUni(GrGLUniformManager::kInvalidUniformHandle) | |
830 , fEffectMatrix(kCoordsType) { | 829 , fEffectMatrix(kCoordsType) { |
831 } | 830 } |
832 | 831 |
833 GrGLGradientEffect::~GrGLGradientEffect() { } | 832 GrGLGradientEffect::~GrGLGradientEffect() { } |
834 | 833 |
835 void GrGLGradientEffect::emitYCoordUniform(GrGLShaderBuilder* builder) { | 834 void GrGLGradientEffect::emitYCoordUniform(GrGLShaderBuilder* builder) { |
836 fFSYUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, | 835 fFSYUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, |
837 kFloat_GrSLType, "GradientYCoordFS"); | 836 kFloat_GrSLType, "GradientYCoordFS"); |
838 } | 837 } |
839 | 838 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 (*stops)[i] = stop; | 976 (*stops)[i] = stop; |
978 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; |
979 } | 978 } |
980 } | 979 } |
981 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 980 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
982 | 981 |
983 return outColors; | 982 return outColors; |
984 } | 983 } |
985 | 984 |
986 #endif | 985 #endif |
OLD | NEW |