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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointRadialGradient) | 845 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointRadialGradient) |
846 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointConicalGradient) | 846 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointConicalGradient) |
847 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 847 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
848 | 848 |
849 /////////////////////////////////////////////////////////////////////////////// | 849 /////////////////////////////////////////////////////////////////////////////// |
850 | 850 |
851 #if SK_SUPPORT_GPU | 851 #if SK_SUPPORT_GPU |
852 | 852 |
853 #include "effects/GrTextureStripAtlas.h" | 853 #include "effects/GrTextureStripAtlas.h" |
854 #include "GrTBackendEffectFactory.h" | 854 #include "GrTBackendEffectFactory.h" |
| 855 #include "gl/GrGLShaderBuilder.h" |
855 #include "SkGr.h" | 856 #include "SkGr.h" |
856 | 857 |
857 GrGLGradientEffect::GrGLGradientEffect(const GrBackendEffectFactory& factory) | 858 GrGLGradientEffect::GrGLGradientEffect(const GrBackendEffectFactory& factory) |
858 : INHERITED(factory) | 859 : INHERITED(factory) |
859 , fCachedYCoord(SK_ScalarMax) { | 860 , fCachedYCoord(SK_ScalarMax) { |
860 } | 861 } |
861 | 862 |
862 GrGLGradientEffect::~GrGLGradientEffect() { } | 863 GrGLGradientEffect::~GrGLGradientEffect() { } |
863 | 864 |
864 void GrGLGradientEffect::emitUniforms(GrGLShaderBuilder* builder, EffectKey key)
{ | 865 void GrGLGradientEffect::emitUniforms(GrGLShaderBuilder* builder, EffectKey key)
{ |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 (*stops)[i] = stop; | 1148 (*stops)[i] = stop; |
1148 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1149 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
1149 } | 1150 } |
1150 } | 1151 } |
1151 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1152 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1152 | 1153 |
1153 return outColors; | 1154 return outColors; |
1154 } | 1155 } |
1155 | 1156 |
1156 #endif | 1157 #endif |
OLD | NEW |