Create GLSL base class for ProgramDataManager
BUG=skia:
Review URL: https://codereview.chromium.org/1428543003
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index 590287e..7320b2d 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -60,7 +60,7 @@
}
}
-void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const {
+void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kSampler2D_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -76,7 +76,7 @@
}
}
-void GrGLProgramDataManager::set1f(UniformHandle u, GrGLfloat v0) const {
+void GrGLProgramDataManager::set1f(UniformHandle u, float v0) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kFloat_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -91,7 +91,7 @@
void GrGLProgramDataManager::set1fv(UniformHandle u,
int arrayCount,
- const GrGLfloat v[]) const {
+ const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kFloat_GrSLType);
SkASSERT(arrayCount > 0);
@@ -108,7 +108,7 @@
}
}
-void GrGLProgramDataManager::set2f(UniformHandle u, GrGLfloat v0, GrGLfloat v1) const {
+void GrGLProgramDataManager::set2f(UniformHandle u, float v0, float v1) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec2f_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -123,7 +123,7 @@
void GrGLProgramDataManager::set2fv(UniformHandle u,
int arrayCount,
- const GrGLfloat v[]) const {
+ const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec2f_GrSLType);
SkASSERT(arrayCount > 0);
@@ -137,7 +137,7 @@
}
}
-void GrGLProgramDataManager::set3f(UniformHandle u, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2) const {
+void GrGLProgramDataManager::set3f(UniformHandle u, float v0, float v1, float v2) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec3f_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -152,7 +152,7 @@
void GrGLProgramDataManager::set3fv(UniformHandle u,
int arrayCount,
- const GrGLfloat v[]) const {
+ const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec3f_GrSLType);
SkASSERT(arrayCount > 0);
@@ -167,10 +167,10 @@
}
void GrGLProgramDataManager::set4f(UniformHandle u,
- GrGLfloat v0,
- GrGLfloat v1,
- GrGLfloat v2,
- GrGLfloat v3) const {
+ float v0,
+ float v1,
+ float v2,
+ float v3) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec4f_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -185,7 +185,7 @@
void GrGLProgramDataManager::set4fv(UniformHandle u,
int arrayCount,
- const GrGLfloat v[]) const {
+ const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec4f_GrSLType);
SkASSERT(arrayCount > 0);
@@ -199,7 +199,7 @@
}
}
-void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix[]) const {
+void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const float matrix[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kMat33f_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -212,7 +212,7 @@
}
}
-void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix[]) const {
+void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const float matrix[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kMat44f_GrSLType);
SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
@@ -227,7 +227,7 @@
void GrGLProgramDataManager::setMatrix3fv(UniformHandle u,
int arrayCount,
- const GrGLfloat matrices[]) const {
+ const float matrices[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kMat33f_GrSLType);
SkASSERT(arrayCount > 0);
@@ -245,7 +245,7 @@
void GrGLProgramDataManager::setMatrix4fv(UniformHandle u,
int arrayCount,
- const GrGLfloat matrices[]) const {
+ const float matrices[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kMat44f_GrSLType);
SkASSERT(arrayCount > 0);
@@ -262,7 +262,7 @@
}
void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) const {
- GrGLfloat mt[] = {
+ float mt[] = {
matrix.get(SkMatrix::kMScaleX),
matrix.get(SkMatrix::kMSkewY),
matrix.get(SkMatrix::kMPersp0),