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 #ifndef GrGLProgramDataManager_DEFINED | 8 #ifndef GrGLProgramDataManager_DEFINED |
9 #define GrGLProgramDataManager_DEFINED | 9 #define GrGLProgramDataManager_DEFINED |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // This uses an allocator rather than array so that the GrGLSLShaderVars don
't move in memory | 40 // This uses an allocator rather than array so that the GrGLSLShaderVars don
't move in memory |
41 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars
and ptrs to their | 41 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars
and ptrs to their |
42 // name strings. Otherwise, we'd have to hand out copies. | 42 // name strings. Otherwise, we'd have to hand out copies. |
43 typedef GrTAllocator<UniformInfo> UniformInfoArray; | 43 typedef GrTAllocator<UniformInfo> UniformInfoArray; |
44 typedef GrTAllocator<VaryingInfo> VaryingInfoArray; | 44 typedef GrTAllocator<VaryingInfo> VaryingInfoArray; |
45 | 45 |
46 GrGLProgramDataManager(GrGLGpu*, GrGLuint programID, const UniformInfoArray&
, | 46 GrGLProgramDataManager(GrGLGpu*, GrGLuint programID, const UniformInfoArray&
, |
47 const VaryingInfoArray&); | 47 const VaryingInfoArray&); |
48 | 48 |
| 49 |
| 50 void setSamplers(const SkTArray<GrGLSampler>& samplers) const; |
| 51 |
49 /** Functions for uploading uniform values. The varities ending in v can be
used to upload to an | 52 /** Functions for uploading uniform values. The varities ending in v can be
used to upload to an |
50 * array of uniforms. arrayCount must be <= the array count of the uniform. | 53 * array of uniforms. arrayCount must be <= the array count of the uniform. |
51 */ | 54 */ |
52 void setSampler(UniformHandle, int texUnit) const; | |
53 | |
54 void set1f(UniformHandle, float v0) const override; | 55 void set1f(UniformHandle, float v0) const override; |
55 void set1fv(UniformHandle, int arrayCount, const float v[]) const override; | 56 void set1fv(UniformHandle, int arrayCount, const float v[]) const override; |
56 void set2f(UniformHandle, float, float) const override; | 57 void set2f(UniformHandle, float, float) const override; |
57 void set2fv(UniformHandle, int arrayCount, const float v[]) const override; | 58 void set2fv(UniformHandle, int arrayCount, const float v[]) const override; |
58 void set3f(UniformHandle, float, float, float) const override; | 59 void set3f(UniformHandle, float, float, float) const override; |
59 void set3fv(UniformHandle, int arrayCount, const float v[]) const override; | 60 void set3fv(UniformHandle, int arrayCount, const float v[]) const override; |
60 void set4f(UniformHandle, float, float, float, float) const override; | 61 void set4f(UniformHandle, float, float, float, float) const override; |
61 void set4fv(UniformHandle, int arrayCount, const float v[]) const override; | 62 void set4fv(UniformHandle, int arrayCount, const float v[]) const override; |
62 // matrices are column-major, the first three upload a single matrix, the la
tter three upload | 63 // matrices are column-major, the first three upload a single matrix, the la
tter three upload |
63 // arrayCount matrices into a uniform array. | 64 // arrayCount matrices into a uniform array. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 SkTArray<Uniform, true> fUniforms; | 106 SkTArray<Uniform, true> fUniforms; |
106 SkTArray<PathProcVarying, true> fPathProcVaryings; | 107 SkTArray<PathProcVarying, true> fPathProcVaryings; |
107 GrGLGpu* fGpu; | 108 GrGLGpu* fGpu; |
108 GrGLuint fProgramID; | 109 GrGLuint fProgramID; |
109 | 110 |
110 typedef GrGLSLProgramDataManager INHERITED; | 111 typedef GrGLSLProgramDataManager INHERITED; |
111 }; | 112 }; |
112 | 113 |
113 #endif | 114 #endif |
OLD | NEW |