Index: src/gpu/gl/GrGLProgramDataManager.cpp |
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp |
index 93e9a5d9312b6623ce5c37166ed13c04471d8127..ed497bd1926b09343f1e761d1a6df648118ac3ae 100644 |
--- a/src/gpu/gl/GrGLProgramDataManager.cpp |
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp |
@@ -5,10 +5,9 @@ |
* found in the LICENSE file. |
*/ |
+#include "SkMatrix.h" |
#include "gl/GrGLProgramDataManager.h" |
-#include "gl/GrGLUniformHandle.h" |
#include "gl/GrGLGpu.h" |
-#include "SkMatrix.h" |
#define ASSERT_ARRAY_UPLOAD_IN_BOUNDS(UNI, COUNT) \ |
SkASSERT(arrayCount <= uni.fArrayCount || \ |
@@ -43,7 +42,7 @@ GrGLProgramDataManager::GrGLProgramDataManager(GrGLGpu* gpu, const UniformInfoAr |
} |
void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kSampler2D_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
// FIXME: We still insert a single sampler uniform for every stage. If the shader does not |
@@ -59,7 +58,7 @@ void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const |
} |
void GrGLProgramDataManager::set1f(UniformHandle u, GrGLfloat v0) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kFloat_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -74,7 +73,7 @@ void GrGLProgramDataManager::set1f(UniformHandle u, GrGLfloat v0) const { |
void GrGLProgramDataManager::set1fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat v[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kFloat_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |
@@ -91,7 +90,7 @@ void GrGLProgramDataManager::set1fv(UniformHandle u, |
} |
void GrGLProgramDataManager::set2f(UniformHandle u, GrGLfloat v0, GrGLfloat v1) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec2f_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -106,7 +105,7 @@ void GrGLProgramDataManager::set2f(UniformHandle u, GrGLfloat v0, GrGLfloat v1) |
void GrGLProgramDataManager::set2fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat v[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec2f_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |
@@ -120,7 +119,7 @@ void GrGLProgramDataManager::set2fv(UniformHandle u, |
} |
void GrGLProgramDataManager::set3f(UniformHandle u, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec3f_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -135,7 +134,7 @@ void GrGLProgramDataManager::set3f(UniformHandle u, GrGLfloat v0, GrGLfloat v1, |
void GrGLProgramDataManager::set3fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat v[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec3f_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |
@@ -153,7 +152,7 @@ void GrGLProgramDataManager::set4f(UniformHandle u, |
GrGLfloat v1, |
GrGLfloat v2, |
GrGLfloat v3) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec4f_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -168,7 +167,7 @@ void GrGLProgramDataManager::set4f(UniformHandle u, |
void GrGLProgramDataManager::set4fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat v[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kVec4f_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |
@@ -182,7 +181,7 @@ void GrGLProgramDataManager::set4fv(UniformHandle u, |
} |
void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kMat33f_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -195,7 +194,7 @@ void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix |
} |
void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kMat44f_GrSLType); |
SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
SkDEBUGCODE(this->printUnused(uni);) |
@@ -210,7 +209,7 @@ void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix |
void GrGLProgramDataManager::setMatrix3fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat matrices[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kMat33f_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |
@@ -228,7 +227,7 @@ void GrGLProgramDataManager::setMatrix3fv(UniformHandle u, |
void GrGLProgramDataManager::setMatrix4fv(UniformHandle u, |
int arrayCount, |
const GrGLfloat matrices[]) const { |
- const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
+ const Uniform& uni = fUniforms[u.toIndex()]; |
SkASSERT(uni.fType == kMat44f_GrSLType); |
SkASSERT(arrayCount > 0); |
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount); |