OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 "gl/GrGLShaderBuilder.h" | 8 #include "gl/GrGLShaderBuilder.h" |
9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 : INHERITED(gpu, uniformManager, desc) | 936 : INHERITED(gpu, uniformManager, desc) |
937 , fNumTexCoordSets(0) { | 937 , fNumTexCoordSets(0) { |
938 | 938 |
939 SkASSERT(!desc.getHeader().fHasVertexCode); | 939 SkASSERT(!desc.getHeader().fHasVertexCode); |
940 SkASSERT(gpu->glCaps().fixedFunctionSupport()); | 940 SkASSERT(gpu->glCaps().fixedFunctionSupport()); |
941 SkASSERT(gpu->glCaps().pathRenderingSupport()); | 941 SkASSERT(gpu->glCaps().pathRenderingSupport()); |
942 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); | 942 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); |
943 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); | 943 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); |
944 } | 944 } |
945 | 945 |
| 946 int GrGLFragmentOnlyShaderBuilder::addTexCoordSets(int count) { |
| 947 int firstFreeCoordSet = fNumTexCoordSets; |
| 948 fNumTexCoordSets += count; |
| 949 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fNumTexCoordSets
); |
| 950 return firstFreeCoordSet; |
| 951 } |
| 952 |
946 GrGLProgramEffects* GrGLFragmentOnlyShaderBuilder::createAndEmitEffects( | 953 GrGLProgramEffects* GrGLFragmentOnlyShaderBuilder::createAndEmitEffects( |
947 const GrEffectStage* effectStages[], | 954 const GrEffectStage* effectStages[], |
948 const EffectKey effectKeys[], | 955 const EffectKey effectKeys[], |
949 int effectCnt, | 956 int effectCnt, |
950 GrGLSLExpr<4>* inOutFSColor) { | 957 GrGLSLExpr<4>* inOutFSColor) { |
951 | 958 |
952 GrGLTexGenProgramEffectsBuilder texGenEffectsBuilder(this, effectCnt); | 959 GrGLTexGenProgramEffectsBuilder texGenEffectsBuilder(this, effectCnt); |
953 this->INHERITED::createAndEmitEffects(&texGenEffectsBuilder, | 960 this->INHERITED::createAndEmitEffects(&texGenEffectsBuilder, |
954 effectStages, | 961 effectStages, |
955 effectKeys, | 962 effectKeys, |
956 effectCnt, | 963 effectCnt, |
957 inOutFSColor); | 964 inOutFSColor); |
958 return texGenEffectsBuilder.finish(); | 965 return texGenEffectsBuilder.finish(); |
959 } | 966 } |
OLD | NEW |