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

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

Issue 611653002: Cleanup of shader building system (Closed) Base URL: https://skia.googlesource.com/skia.git@solo_gp
Patch Set: Created 6 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 8a98a75caea0eff1a62d52cbc214f16497dd62ac..bbf7d42e89b5d12f0e18c9542487890d7c394b00 100644
--- a/src/gpu/gl/GrGLProgramDataManager.h
+++ b/src/gpu/gl/GrGLProgramDataManager.h
@@ -56,22 +56,18 @@ public:
friend class GrGLProgramBuilder; // For accessing toShaderBuilderIndex().
};
- class VaryingHandle : public ShaderResourceHandle {
- public:
- /** Creates a reference to a varying in separable varyings of a GrGLShaderBuilder.
- * The ref can be used to set the varying with the corresponding GrGLProgramDataManager.*/
- static VaryingHandle CreateFromSeparableVaryingIndex(int i) {
- return VaryingHandle(i);
- }
- VaryingHandle() { }
- bool operator==(const VaryingHandle& other) const { return other.fValue == fValue; }
- private:
- VaryingHandle(int value) : ShaderResourceHandle(value) { }
- int toProgramDataIndex() const { SkASSERT(isValid()); return fValue; }
- friend class GrGLProgramDataManager; // For accessing toProgramDataIndex().
+ struct UniformInfo {
+ GrGLShaderVar fVariable;
+ uint32_t fVisibility;
+ GrGLint fLocation;
};
- GrGLProgramDataManager(GrGpuGL*, GrGLProgram*, const GrGLProgramBuilder&);
+ // This uses an allocator rather than array so that the GrGLShaderVars don't move in memory
+ // after they are inserted. Users of GrGLShaderBuilder get refs to the vars and ptrs to their
+ // name strings. Otherwise, we'd have to hand out copies.
+ typedef GrTAllocator<UniformInfo> UniformInfoArray;
+
+ GrGLProgramDataManager(GrGpuGL*, const UniformInfoArray&);
/** 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.
@@ -95,10 +91,6 @@ public:
// convenience method for uploading a SkMatrix to a 3x3 matrix uniform
void setSkMatrix(UniformHandle, const SkMatrix&) const;
- void setProgramPathFragmentInputTransform(VaryingHandle i,
- unsigned components,
- const SkMatrix& matrix) const;
-
private:
enum {
kUnusedUniform = -1,
@@ -112,19 +104,10 @@ private:
int fArrayCount;
);
};
- struct Varying {
- GrGLint fLocation;
- SkDEBUGCODE(
- GrSLType fType;
- );
- };
SkTArray<Uniform, true> fUniforms;
- SkTArray<Varying, true> fVaryings;
GrGpuGL* fGpu;
- GrGLProgram* fProgram;
typedef SkRefCnt 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