Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: src/gpu/gl/GrGLProgramDataManager.h

Issue 1428543003: Create GLSL base class for ProgramDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add space Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698