Index: src/gpu/GrAAConvexPathRenderer.cpp |
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp |
index e4fc6ec87d914741bfd47b96f0cdd8c48936497c..c6238d7f77a12289ac2e7424d80d1f07c395c19e 100644 |
--- a/src/gpu/GrAAConvexPathRenderer.cpp |
+++ b/src/gpu/GrAAConvexPathRenderer.cpp |
@@ -21,9 +21,9 @@ |
#include "gl/GrGLEffect.h" |
#include "gl/GrGLSL.h" |
-#include "gl/GrGLVertexEffect.h" |
+#include "gl/GrGLGeometryProcessor.h" |
-#include "effects/GrVertexEffect.h" |
+#include "effects/GrGeometryProcessor.h" |
GrAAConvexPathRenderer::GrAAConvexPathRenderer() { |
} |
@@ -504,7 +504,11 @@ static void create_vertices(const SegmentArray& segments, |
* Requires shader derivative instruction support. |
*/ |
-class QuadEdgeEffect : public GrVertexEffect { |
+const GrShaderVar kAttrQuadEdge("aQuadEdge", |
bsalomon
2014/09/08 21:17:50
Chrome doesn't allow us to have statically initial
|
+ kVec4f_GrSLType, |
+ GrShaderVar::kAttribute_TypeModifier); |
+ |
+class QuadEdgeEffect : public GrGeometryProcessor { |
public: |
static GrEffect* Create() { |
@@ -526,7 +530,7 @@ public: |
return GrTBackendEffectFactory<QuadEdgeEffect>::getInstance(); |
} |
- class GLEffect : public GrGLVertexEffect { |
+ class GLEffect : public GrGLGeometryProcessor { |
public: |
GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
: INHERITED (factory) {} |
@@ -568,9 +572,7 @@ public: |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str()); |
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); |
- const SkString* attr0Name = |
- vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- vsBuilder->codeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str()); |
+ vsBuilder->codeAppendf("\t%s = %s;\n", vsName, kAttrQuadEdge.c_str()); |
} |
static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*) {} |
@@ -578,12 +580,12 @@ public: |
virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {} |
private: |
- typedef GrGLVertexEffect INHERITED; |
+ typedef GrGLGeometryProcessor INHERITED; |
}; |
private: |
QuadEdgeEffect() { |
- this->addVertexAttrib(kVec4f_GrSLType); |
+ this->addVertexAttrib(kAttrQuadEdge); |
} |
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE { |
@@ -676,9 +678,8 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath, |
drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs), sizeof(QuadVertex)); |
- static const int kEdgeAttrIndex = 1; |
GrEffect* quadEffect = QuadEdgeEffect::Create(); |
- drawState->setGeometryProcessor(quadEffect, kEdgeAttrIndex)->unref(); |
+ drawState->setGeometryProcessor(quadEffect)->unref(); |
GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); |
if (!arg.succeeded()) { |