Index: src/gpu/effects/GrGeometryProcessor.h |
diff --git a/src/gpu/effects/GrVertexEffect.h b/src/gpu/effects/GrGeometryProcessor.h |
similarity index 59% |
rename from src/gpu/effects/GrVertexEffect.h |
rename to src/gpu/effects/GrGeometryProcessor.h |
index 323c85e34e11501bc5260b0d0ad75b1ac38abb93..0879f64123297601a1a52e09a3091c995f01d1ff 100644 |
--- a/src/gpu/effects/GrVertexEffect.h |
+++ b/src/gpu/effects/GrGeometryProcessor.h |
@@ -5,8 +5,8 @@ |
* found in the LICENSE file. |
*/ |
-#ifndef GrVertexEffect_DEFINED |
-#define GrVertexEffect_DEFINED |
+#ifndef GrGeometryProcessor_DEFINED |
+#define GrGeometryProcessor_DEFINED |
#include "GrEffect.h" |
@@ -15,19 +15,22 @@ |
* Otherwise it won't be able to add vertex attribs, and it might be given a vertexless shader |
* program in emitCode. |
*/ |
-class GrVertexEffect : public GrEffect { |
+class GrGeometryProcessor : public GrEffect { |
public: |
- GrVertexEffect() { fRequiresVertexShader = true; } |
+ GrGeometryProcessor() { fRequiresVertexShader = true; } |
protected: |
/** |
* Subclasses call this from their constructor to register vertex attributes (at most |
* kMaxVertexAttribs). This must only be called from the constructor because GrEffects are |
* immutable. |
+ * |
+ * We return a reference to the added var so that derived classes can name it nicely and use it |
+ * in shader code. |
*/ |
- void addVertexAttrib(GrSLType type) { |
- SkASSERT(fVertexAttribTypes.count() < kMaxVertexAttribs); |
- fVertexAttribTypes.push_back(type); |
+ GrShaderVar& addVertexAttrib(const GrShaderVar& var) { |
bsalomon
2014/09/12 00:34:17
I think this should just take a type and a name (a
joshua.litt
2014/09/12 00:46:07
Non const ref was a mistake, I meant to return a c
egdaniel
2014/09/12 01:12:27
Do we want to be dealing precision issues at this
bsalomon
2014/09/12 01:17:47
I think you're right that we don't need precision
joshua.litt
2014/09/12 01:35:28
I can remove precision from GrShaderVar along with
egdaniel
2014/09/12 02:09:18
I was suggesting removing precision from GrShaderV
|
+ SkASSERT(fVertexAttribs.count() < kMaxVertexAttribs); |
+ return fVertexAttribs.push_back(var); |
} |
private: |