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 #ifndef GrGLNvprProgramBuilder_DEFINED | 8 #ifndef GrGLNvprProgramBuilder_DEFINED |
9 #define GrGLNvprProgramBuilder_DEFINED | 9 #define GrGLNvprProgramBuilder_DEFINED |
10 | 10 |
11 #include "GrGLProgramBuilder.h" | 11 #include "GrGLProgramBuilder.h" |
12 | 12 |
13 class GrGLNvprProgramBuilder : public GrGLProgramBuilder { | 13 class GrGLNvprProgramBuilder : public GrGLProgramBuilder { |
14 public: | 14 public: |
15 GrGLNvprProgramBuilder(GrGLGpu*, const GrOptDrawState&); | 15 GrGLNvprProgramBuilder(GrGLGpu*, const GrOptDrawState&); |
16 | 16 |
17 /* | 17 /* |
18 * The separable varying info must be passed to GrGLProgram so this must | 18 * The separable varying info must be passed to GrGLProgram so this must |
19 * be part of the public interface | 19 * be part of the public interface |
20 */ | 20 */ |
21 struct SeparableVaryingInfo { | 21 struct SeparableVaryingInfo { |
22 GrGLShaderVar fVariable; | 22 GrGLShaderVar fVariable; |
23 GrGLint fLocation; | 23 GrGLint fLocation; |
24 }; | 24 }; |
25 | 25 |
26 typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray; | 26 typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray; |
27 | 27 |
28 virtual GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE; | 28 GrGLProgram* createProgram(GrGLuint programID) SK_OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 virtual void emitTransforms(const GrPendingFragmentStage&, | 31 virtual void emitTransforms(const GrPendingFragmentStage&, |
32 GrGLProcessor::TransformedCoordsArray* outCoords
, | 32 GrGLProcessor::TransformedCoordsArray* outCoords
, |
33 GrGLInstalledFragProc*) SK_OVERRIDE; | 33 GrGLInstalledFragProc*) SK_OVERRIDE; |
34 | 34 |
35 typedef GrGLInstalledFragProc::ShaderVarHandle ShaderVarHandle; | 35 typedef GrGLInstalledFragProc::ShaderVarHandle ShaderVarHandle; |
36 | 36 |
37 /** | 37 /** |
38 * Add a separable varying input variable to the current program. | 38 * Add a separable varying input variable to the current program. |
39 * A separable varying (fragment shader input) is a varying that can be used
also when vertex | 39 * A separable varying (fragment shader input) is a varying that can be used
also when vertex |
40 * shaders are not used. With a vertex shader, the operation is same as with
other | 40 * shaders are not used. With a vertex shader, the operation is same as with
other |
41 * varyings. Without a vertex shader, such as with NV_path_rendering, GL API
s are used to | 41 * varyings. Without a vertex shader, such as with NV_path_rendering, GL API
s are used to |
42 * populate the variable. The APIs can refer to the variable through the ret
urned handle. | 42 * populate the variable. The APIs can refer to the variable through the ret
urned handle. |
43 */ | 43 */ |
44 ShaderVarHandle addSeparableVarying(const char* name, GrGLVarying* v); | 44 ShaderVarHandle addSeparableVarying(const char* name, GrGLVarying* v); |
45 | 45 |
46 void resolveSeparableVaryings(GrGLuint programId); | 46 void resolveSeparableVaryings(GrGLuint programId); |
47 | 47 |
48 SeparableVaryingInfoArray fSeparableVaryingInfos; | 48 SeparableVaryingInfoArray fSeparableVaryingInfos; |
49 | 49 |
50 typedef GrGLProgramBuilder INHERITED; | 50 typedef GrGLProgramBuilder INHERITED; |
51 }; | 51 }; |
52 | 52 |
53 #endif | 53 #endif |
OLD | NEW |