| Index: src/gpu/gl/GrGLProgramDataManager.h
|
| diff --git a/src/gpu/gl/GrGLProgramDataManager.h b/src/gpu/gl/GrGLProgramDataManager.h
|
| index 04d519fb168bed86b38576abc0e87d9817d7567b..ea7b19e0346b294a2ab353c8d2e192feafdc3e6f 100644
|
| --- a/src/gpu/gl/GrGLProgramDataManager.h
|
| +++ b/src/gpu/gl/GrGLProgramDataManager.h
|
| @@ -8,6 +8,8 @@
|
| #ifndef GrGLProgramDataManager_DEFINED
|
| #define GrGLProgramDataManager_DEFINED
|
|
|
| +#include "glsl/GrGLSLProgramDataManager.h"
|
| +
|
| #include "GrAllocator.h"
|
| #include "gl/GrGLTypes.h"
|
| #include "glsl/GrGLSLShaderVar.h"
|
| @@ -23,31 +25,8 @@ class GrGLProgramBuilder;
|
| * The resources are objects the program uses to communicate with the
|
| * application code.
|
| */
|
| -class GrGLProgramDataManager : SkNoncopyable {
|
| +class GrGLProgramDataManager : public GrGLSLProgramDataManager {
|
| public:
|
| - // Opaque handle to a resource
|
| - class ShaderResourceHandle {
|
| - public:
|
| - ShaderResourceHandle(int value)
|
| - : fValue(value) {
|
| - SkASSERT(this->isValid());
|
| - }
|
| -
|
| - ShaderResourceHandle()
|
| - : fValue(kInvalid_ShaderResourceHandle) {
|
| - }
|
| -
|
| - bool operator==(const ShaderResourceHandle& other) const { return other.fValue == fValue; }
|
| - bool isValid() const { return kInvalid_ShaderResourceHandle != fValue; }
|
| - int toIndex() const { SkASSERT(this->isValid()); return fValue; }
|
| -
|
| - private:
|
| - static const int kInvalid_ShaderResourceHandle = -1;
|
| - int fValue;
|
| - };
|
| -
|
| - typedef ShaderResourceHandle UniformHandle;
|
| -
|
| struct UniformInfo {
|
| GrGLSLShaderVar fVariable;
|
| uint32_t fVisibility;
|
| @@ -71,29 +50,29 @@ public:
|
| /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
|
| * 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 arrayCount, const GrGLfloat v[]) const;
|
| - void set2f(UniformHandle, GrGLfloat, GrGLfloat) const;
|
| - void set2fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| - void set3f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat) const;
|
| - void set3fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| - void set4f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat, GrGLfloat) const;
|
| - void set4fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
|
| + void setSampler(UniformHandle, int texUnit) const;
|
| +
|
| + void set1f(UniformHandle, float v0) const override;
|
| + void set1fv(UniformHandle, int arrayCount, const float v[]) const override;
|
| + void set2f(UniformHandle, float, float) const override;
|
| + void set2fv(UniformHandle, int arrayCount, const float v[]) const override;
|
| + void set3f(UniformHandle, float, float, float) const override;
|
| + void set3fv(UniformHandle, int arrayCount, const float v[]) const override;
|
| + void set4f(UniformHandle, float, float, float, float) const override;
|
| + void set4fv(UniformHandle, int arrayCount, const float v[]) const override;
|
| // 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 arrayCount, const GrGLfloat matrices[]) const;
|
| - void setMatrix4fv(UniformHandle, int arrayCount, const GrGLfloat matrices[]) const;
|
| + void setMatrix3f(UniformHandle, const float matrix[]) const override;
|
| + void setMatrix4f(UniformHandle, const float matrix[]) const override;
|
| + void setMatrix3fv(UniformHandle, int arrayCount, const float matrices[]) const override;
|
| + void setMatrix4fv(UniformHandle, int arrayCount, const float matrices[]) const override;
|
|
|
| // convenience method for uploading a SkMatrix to a 3x3 matrix uniform
|
| - void setSkMatrix(UniformHandle, const SkMatrix&) const;
|
| + void setSkMatrix(UniformHandle, const SkMatrix&) const override;
|
|
|
| // for nvpr only
|
| - typedef GrGLProgramDataManager::ShaderResourceHandle SeparableVaryingHandle;
|
| void setPathFragmentInputTransform(SeparableVaryingHandle u, int components,
|
| - const SkMatrix& matrix) const;
|
| + const SkMatrix& matrix) const override;
|
|
|
| private:
|
| enum {
|
| @@ -127,7 +106,7 @@ private:
|
| GrGLGpu* fGpu;
|
| GrGLuint fProgramID;
|
|
|
| - typedef SkNoncopyable INHERITED;
|
| + typedef GrGLSLProgramDataManager INHERITED;
|
| };
|
|
|
| #endif
|
|
|