| Index: src/gpu/gl/GrGLUniformManager.h
|
| diff --git a/src/gpu/gl/GrGLUniformManager.h b/src/gpu/gl/GrGLUniformManager.h
|
| index eefab049865070d92ea57cb88ccdfb536fea3a18..d7438f9ed7920a662adcfc992c51779aa9de476c 100644
|
| --- a/src/gpu/gl/GrGLUniformManager.h
|
| +++ b/src/gpu/gl/GrGLUniformManager.h
|
| @@ -46,28 +46,28 @@ public:
|
| friend class GrGLUniformManager; // For accessing toUniformIndex().
|
| };
|
|
|
| - GrGLUniformManager(GrGpuGL* gpu) : fGpu(gpu) {}
|
| + GrGLUniformManager(GrGpuGL* gpu);
|
|
|
| UniformHandle appendUniform(GrSLType type, int arrayCount = GrGLShaderVar::kNonArray);
|
|
|
| /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
|
| - * array of uniforms. offset + arrayCount must be <= the array count of the uniform.
|
| + * array of uniforms. arrayCount must be <= the array count of the uniform.
|
| */
|
| void setSampler(UniformHandle, GrGLint texUnit) const;
|
| void set1f(UniformHandle, GrGLfloat v0) const;
|
| - void set1fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
|
| + void set1fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| void set2f(UniformHandle, GrGLfloat, GrGLfloat) const;
|
| - void set2fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
|
| + void set2fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| void set3f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat) const;
|
| - void set3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
|
| + void set3fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| void set4f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat, GrGLfloat) const;
|
| - void set4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
|
| + void set4fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| // matrices are column-major, the first three upload a single matrix, the latter three upload
|
| // arrayCount matrices into a uniform array.
|
| void setMatrix3f(UniformHandle, const GrGLfloat matrix[]) const;
|
| void setMatrix4f(UniformHandle, const GrGLfloat matrix[]) const;
|
| - void setMatrix3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat matrices[]) const;
|
| - void setMatrix4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat matrices[]) const;
|
| + void setMatrix3fv(UniformHandle, int arrayCount, const GrGLfloat matrices[]) const;
|
| + void setMatrix4fv(UniformHandle, int arrayCount, const GrGLfloat matrices[]) const;
|
|
|
| // convenience method for uploading a SkMatrix to a 3x3 matrix uniform
|
| void setSkMatrix(UniformHandle, const SkMatrix&) const;
|
| @@ -82,6 +82,13 @@ public:
|
| typedef GrTAllocator<BuilderUniform> BuilderUniformArray;
|
|
|
| /**
|
| + * Called by the GrGLShaderBuilder to know if the manager is using
|
| + * BindUniformLocation. In that case getUniformLocations must be called
|
| + * before the program is linked.
|
| + */
|
| + bool isUsingBindUniform() const { return fUsingBindUniform; }
|
| +
|
| + /**
|
| * Called by the GrGLShaderBuilder to get GL locations for all uniforms.
|
| */
|
| void getUniformLocations(GrGLuint programID, const BuilderUniformArray& uniforms);
|
| @@ -103,6 +110,7 @@ private:
|
| int fArrayCount;
|
| };
|
|
|
| + bool fUsingBindUniform;
|
| SkTArray<Uniform, true> fUniforms;
|
| GrGpuGL* fGpu;
|
| };
|
|
|