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

Unified Diff: src/gpu/effects/GrBezierEffect.cpp

Issue 23754003: Isolate VertexBuilder from GrGLShaderBuilder (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBezierEffect.cpp
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index c5c903b204fc8add574c9a0f419a87e5f4e525c6..0d57b107acdfb2b784f53385fd08bd6ec3da7d59 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -45,13 +45,16 @@ void GrGLConicEffect::emitCode(GrGLShaderBuilder* builder,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder();
+ SkASSERT(NULL != vertexBuilder);
+
const char *vsName, *fsName;
- builder->addVarying(kVec4f_GrSLType, "ConicCoeffs",
- &vsName, &fsName);
+ vertexBuilder->addVarying(kVec4f_GrSLType, "ConicCoeffs",
+ &vsName, &fsName);
const SkString* attr0Name =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
- builder->vsCodeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str());
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str());
builder->fsCodeAppend("\t\tfloat edgeAlpha;\n");
@@ -185,13 +188,16 @@ void GrGLQuadEffect::emitCode(GrGLShaderBuilder* builder,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder();
+ SkASSERT(NULL != vertexBuilder);
+
const char *vsName, *fsName;
const SkString* attrName =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
builder->fsCodeAppendf("\t\tfloat edgeAlpha;\n");
- builder->addVarying(kVec4f_GrSLType, "HairQuadEdge", &vsName, &fsName);
+ vertexBuilder->addVarying(kVec4f_GrSLType, "HairQuadEdge", &vsName, &fsName);
switch (fEdgeType) {
case kHairAA_GrBezierEdgeType: {
@@ -238,7 +244,7 @@ void GrGLQuadEffect::emitCode(GrGLShaderBuilder* builder,
GrGLSLModulatef<4>(&modulate, inputColor, "edgeAlpha");
builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str());
- builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str());
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str());
}
GrGLEffect::EffectKey GrGLQuadEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
@@ -314,13 +320,16 @@ void GrGLCubicEffect::emitCode(GrGLShaderBuilder* builder,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder();
+ SkASSERT(NULL != vertexBuilder);
+
const char *vsName, *fsName;
- builder->addVarying(kVec4f_GrSLType, "CubicCoeffs",
- &vsName, &fsName);
+ vertexBuilder->addVarying(kVec4f_GrSLType, "CubicCoeffs",
+ &vsName, &fsName);
const SkString* attr0Name =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
- builder->vsCodeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str());
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str());
builder->fsCodeAppend("\t\tfloat edgeAlpha;\n");
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698