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 GrGLUniformManager_DEFINED | 8 #ifndef GrGLUniformManager_DEFINED |
9 #define GrGLUniformManager_DEFINED | 9 #define GrGLUniformManager_DEFINED |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void set3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[])
const; | 62 void set3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[])
const; |
63 void set4f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat, GrGLfloat) const; | 63 void set4f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat, GrGLfloat) const; |
64 void set4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[])
const; | 64 void set4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[])
const; |
65 // matrices are column-major, the first three upload a single matrix, the la
tter three upload | 65 // matrices are column-major, the first three upload a single matrix, the la
tter three upload |
66 // arrayCount matrices into a uniform array. | 66 // arrayCount matrices into a uniform array. |
67 void setMatrix3f(UniformHandle, const GrGLfloat matrix[]) const; | 67 void setMatrix3f(UniformHandle, const GrGLfloat matrix[]) const; |
68 void setMatrix4f(UniformHandle, const GrGLfloat matrix[]) const; | 68 void setMatrix4f(UniformHandle, const GrGLfloat matrix[]) const; |
69 void setMatrix3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat
matrices[]) const; | 69 void setMatrix3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat
matrices[]) const; |
70 void setMatrix4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat
matrices[]) const; | 70 void setMatrix4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat
matrices[]) const; |
71 | 71 |
| 72 /** Functions for setting global GL uniforms. Since anybody can change these
, they need to |
| 73 * be set every time, even if it's the same value as last time. The impleme
ntation will |
| 74 * shadow the state and skip updates where possible. |
| 75 */ |
| 76 void enableGlobalTexGen(int unitIndex, int numComponents, const GrGLfloat* c
oefficients) const; |
| 77 void enableGlobalTexGen(int unitIndex, int numComponents, const SkMatrix& ma
trix) const; |
| 78 |
72 // convenience method for uploading a SkMatrix to a 3x3 matrix uniform | 79 // convenience method for uploading a SkMatrix to a 3x3 matrix uniform |
73 void setSkMatrix(UniformHandle, const SkMatrix&) const; | 80 void setSkMatrix(UniformHandle, const SkMatrix&) const; |
74 | 81 |
75 struct BuilderUniform { | 82 struct BuilderUniform { |
76 GrGLShaderVar fVariable; | 83 GrGLShaderVar fVariable; |
77 uint32_t fVisibility; | 84 uint32_t fVisibility; |
78 }; | 85 }; |
79 // This uses an allocator rather than array so that the GrGLShaderVars don't
move in memory | 86 // This uses an allocator rather than array so that the GrGLShaderVars don't
move in memory |
80 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars
and ptrs to their | 87 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars
and ptrs to their |
81 // name strings. Otherwise, we'd have to hand out copies. | 88 // name strings. Otherwise, we'd have to hand out copies. |
(...skipping 19 matching lines...) Expand all Loading... |
101 GrGLint fFSLocation; | 108 GrGLint fFSLocation; |
102 GrSLType fType; | 109 GrSLType fType; |
103 int fArrayCount; | 110 int fArrayCount; |
104 }; | 111 }; |
105 | 112 |
106 SkTArray<Uniform, true> fUniforms; | 113 SkTArray<Uniform, true> fUniforms; |
107 GrGpuGL* fGpu; | 114 GrGpuGL* fGpu; |
108 }; | 115 }; |
109 | 116 |
110 #endif | 117 #endif |
OLD | NEW |