OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrGLLegacyNvprProgramBuilder.h" | 8 #include "GrGLLegacyNvprProgramBuilder.h" |
9 #include "../GrGpuGL.h" | 9 #include "../GrGpuGL.h" |
10 | 10 |
11 GrGLLegacyNvprProgramBuilder::GrGLLegacyNvprProgramBuilder(GrGpuGL* gpu, | 11 GrGLLegacyNvprProgramBuilder::GrGLLegacyNvprProgramBuilder(GrGpuGL* gpu, |
12 const GrOptDrawState&
optState, | 12 const GrOptDrawState&
optState) |
13 const GrGLProgramDesc
& desc) | 13 : INHERITED(gpu, optState) |
14 : INHERITED(gpu, optState, desc) | |
15 , fTexCoordSetCnt(0) { | 14 , fTexCoordSetCnt(0) { |
16 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); | |
17 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); | |
18 } | 15 } |
19 | 16 |
20 int GrGLLegacyNvprProgramBuilder::addTexCoordSets(int count) { | 17 int GrGLLegacyNvprProgramBuilder::addTexCoordSets(int count) { |
21 int firstFreeCoordSet = fTexCoordSetCnt; | 18 int firstFreeCoordSet = fTexCoordSetCnt; |
22 fTexCoordSetCnt += count; | 19 fTexCoordSetCnt += count; |
23 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; | 20 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; |
24 return firstFreeCoordSet; | 21 return firstFreeCoordSet; |
25 } | 22 } |
26 | 23 |
27 void GrGLLegacyNvprProgramBuilder::emitTransforms(const GrFragmentStage& process
orStage, | 24 void GrGLLegacyNvprProgramBuilder::emitTransforms(const GrFragmentStage& process
orStage, |
(...skipping 15 matching lines...) Expand all Loading... |
43 | 40 |
44 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); | 41 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); |
45 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); | 42 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); |
46 } | 43 } |
47 } | 44 } |
48 | 45 |
49 GrGLProgram* GrGLLegacyNvprProgramBuilder::createProgram(GrGLuint programID) { | 46 GrGLProgram* GrGLLegacyNvprProgramBuilder::createProgram(GrGLuint programID) { |
50 return SkNEW_ARGS(GrGLLegacyNvprProgram, (fGpu, fDesc, fUniformHandles, prog
ramID, fUniforms, | 47 return SkNEW_ARGS(GrGLLegacyNvprProgram, (fGpu, fDesc, fUniformHandles, prog
ramID, fUniforms, |
51 fFragmentProcessors.get(), fTexCo
ordSetCnt)); | 48 fFragmentProcessors.get(), fTexCo
ordSetCnt)); |
52 } | 49 } |
OLD | NEW |