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 : INHERITED(gpu, optState) | 13 const GrProgramDesc&
desc) |
| 14 : INHERITED(gpu, optState, desc) |
14 , fTexCoordSetCnt(0) { | 15 , fTexCoordSetCnt(0) { |
15 } | 16 } |
16 | 17 |
17 int GrGLLegacyNvprProgramBuilder::addTexCoordSets(int count) { | 18 int GrGLLegacyNvprProgramBuilder::addTexCoordSets(int count) { |
18 int firstFreeCoordSet = fTexCoordSetCnt; | 19 int firstFreeCoordSet = fTexCoordSetCnt; |
19 fTexCoordSetCnt += count; | 20 fTexCoordSetCnt += count; |
20 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; | 21 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; |
21 return firstFreeCoordSet; | 22 return firstFreeCoordSet; |
22 } | 23 } |
23 | 24 |
(...skipping 16 matching lines...) Expand all Loading... |
40 | 41 |
41 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); | 42 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); |
42 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); | 43 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); |
43 } | 44 } |
44 } | 45 } |
45 | 46 |
46 GrGLProgram* GrGLLegacyNvprProgramBuilder::createProgram(GrGLuint programID) { | 47 GrGLProgram* GrGLLegacyNvprProgramBuilder::createProgram(GrGLuint programID) { |
47 return SkNEW_ARGS(GrGLLegacyNvprProgram, (fGpu, fDesc, fUniformHandles, prog
ramID, fUniforms, | 48 return SkNEW_ARGS(GrGLLegacyNvprProgram, (fGpu, fDesc, fUniformHandles, prog
ramID, fUniforms, |
48 fFragmentProcessors.get(), fTexCo
ordSetCnt)); | 49 fFragmentProcessors.get(), fTexCo
ordSetCnt)); |
49 } | 50 } |
OLD | NEW |