OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
9 #ifndef GrGLProgram_DEFINED | 9 #ifndef GrGLProgram_DEFINED |
10 #define GrGLProgram_DEFINED | 10 #define GrGLProgram_DEFINED |
11 | 11 |
12 #include "GrGLContext.h" | 12 #include "GrGLContext.h" |
13 #include "GrGLProgramDesc.h" | 13 #include "GrGLProgramDesc.h" |
14 #include "GrGLTexture.h" | 14 #include "GrGLTexture.h" |
15 #include "GrGLProgramDataManager.h" | 15 #include "GrGLProgramDataManager.h" |
16 #include "glsl/GrGLSLProgramDataManager.h" | 16 #include "glsl/GrGLSLProgramDataManager.h" |
| 17 #include "glsl/GrGLSLUniformHandler.h" |
17 | 18 |
18 #include "SkString.h" | 19 #include "SkString.h" |
19 #include "SkXfermode.h" | 20 #include "SkXfermode.h" |
20 | 21 |
21 #include "builders/GrGLProgramBuilder.h" | 22 #include "builders/GrGLProgramBuilder.h" |
22 | 23 |
23 class GrGLInstalledProcessors; | 24 class GrGLInstalledProcessors; |
24 class GrGLProgramBuilder; | 25 class GrGLProgramBuilder; |
25 class GrPipeline; | 26 class GrPipeline; |
26 | 27 |
27 /** | 28 /** |
28 * This class manages a GPU program and records per-program information. | 29 * This class manages a GPU program and records per-program information. |
29 * We can specify the attribute locations so that they are constant | 30 * We can specify the attribute locations so that they are constant |
30 * across our shaders. But the driver determines the uniform locations | 31 * across our shaders. But the driver determines the uniform locations |
31 * at link time. We don't need to remember the sampler uniform location | 32 * at link time. We don't need to remember the sampler uniform location |
32 * because we will bind a texture slot to it and never change it | 33 * because we will bind a texture slot to it and never change it |
33 * Uniforms are program-local so we can't rely on fHWState to hold the | 34 * Uniforms are program-local so we can't rely on fHWState to hold the |
34 * previous uniform state after a program change. | 35 * previous uniform state after a program change. |
35 */ | 36 */ |
36 class GrGLProgram : public SkRefCnt { | 37 class GrGLProgram : public SkRefCnt { |
37 public: | 38 public: |
38 typedef GrGLProgramBuilder::BuiltinUniformHandles BuiltinUniformHandles; | 39 typedef GrGLSLProgramBuilder::BuiltinUniformHandles BuiltinUniformHandles; |
39 | 40 |
40 ~GrGLProgram(); | 41 ~GrGLProgram(); |
41 | 42 |
42 /** | 43 /** |
43 * Call to abandon GL objects owned by this program. | 44 * Call to abandon GL objects owned by this program. |
44 */ | 45 */ |
45 void abandon(); | 46 void abandon(); |
46 | 47 |
47 const GrProgramDesc& getDesc() { return fDesc; } | 48 const GrProgramDesc& getDesc() { return fDesc; } |
48 | 49 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 GrGLGpu* fGpu; | 138 GrGLGpu* fGpu; |
138 GrGLProgramDataManager fProgramDataManager; | 139 GrGLProgramDataManager fProgramDataManager; |
139 SkTArray<UniformHandle> fSamplerUniforms; | 140 SkTArray<UniformHandle> fSamplerUniforms; |
140 | 141 |
141 friend class GrGLProgramBuilder; | 142 friend class GrGLProgramBuilder; |
142 | 143 |
143 typedef SkRefCnt INHERITED; | 144 typedef SkRefCnt INHERITED; |
144 }; | 145 }; |
145 | 146 |
146 #endif | 147 #endif |
OLD | NEW |