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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 #include "gl/GrGLContext.h" | 906 #include "gl/GrGLContext.h" |
907 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 907 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
908 #include "glsl/GrGLSLProgramDataManager.h" | 908 #include "glsl/GrGLSLProgramDataManager.h" |
909 #include "glsl/GrGLSLUniformHandler.h" | 909 #include "glsl/GrGLSLUniformHandler.h" |
910 #include "SkGr.h" | 910 #include "SkGr.h" |
911 | 911 |
912 GrGLGradientEffect::GrGLGradientEffect() | 912 GrGLGradientEffect::GrGLGradientEffect() |
913 : fCachedYCoord(SK_ScalarMax) { | 913 : fCachedYCoord(SK_ScalarMax) { |
914 } | 914 } |
915 | 915 |
916 GrGLGradientEffect::~GrGLGradientEffect() { } | |
917 | |
918 void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler, | 916 void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler, |
919 const GrGradientEffect& ge) { | 917 const GrGradientEffect& ge) { |
920 | 918 |
921 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()) { // 2 Col
or case | 919 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()) { // 2 Col
or case |
922 fColorStartUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragm
ent_Visibility, | 920 fColorStartUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragm
ent_Visibility, |
923 kVec4f_GrSLType, kDefault_Gr
SLPrecision, | 921 kVec4f_GrSLType, kDefault_Gr
SLPrecision, |
924 "GradientStartColor"); | 922 "GradientStartColor"); |
925 fColorEndUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragmen
t_Visibility, | 923 fColorEndUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragmen
t_Visibility, |
926 kVec4f_GrSLType, kDefault_GrSL
Precision, | 924 kVec4f_GrSLType, kDefault_GrSL
Precision, |
927 "GradientEndColor"); | 925 "GradientEndColor"); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 (*stops)[i] = stop; | 1203 (*stops)[i] = stop; |
1206 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
1207 } | 1205 } |
1208 } | 1206 } |
1209 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1210 | 1208 |
1211 return outColors; | 1209 return outColors; |
1212 } | 1210 } |
1213 | 1211 |
1214 #endif | 1212 #endif |
OLD | NEW |