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

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

Issue 1333273003: Start trying to collapse path program stuff (Closed) Base URL: https://skia.googlesource.com/skia.git@removebt
Patch Set: windows Created 5 years, 3 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/GrGLProgramDataManager.h ('k') | src/gpu/gl/GrGLUniformHandle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/gl/GrGLUniformHandle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698