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

Unified Diff: src/gpu/GrOvalRenderer.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/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 5ec750457798af3f38cabb2f498a457a3499b830..de7f4a36ef26917414d30d81c90edb8515613a05 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -91,13 +91,16 @@ public:
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) SK_OVERRIDE {
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder();
+ SkASSERT(NULL != vertexBuilder);
+
const CircleEdgeEffect& circleEffect = drawEffect.castEffect<CircleEdgeEffect>();
const char *vsName, *fsName;
- builder->addVarying(kVec4f_GrSLType, "CircleEdge", &vsName, &fsName);
+ vertexBuilder->addVarying(kVec4f_GrSLType, "CircleEdge", &vsName, &fsName);
const SkString* attrName =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
- builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str());
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str());
builder->fsCodeAppendf("\tfloat d = length(%s.xy);\n", fsName);
builder->fsCodeAppendf("\tfloat edgeAlpha = clamp(%s.z - d, 0.0, 1.0);\n", fsName);
@@ -202,20 +205,23 @@ public:
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) SK_OVERRIDE {
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder();
+ SkASSERT(NULL != vertexBuilder);
+
const EllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<EllipseEdgeEffect>();
const char *vsOffsetName, *fsOffsetName;
const char *vsRadiiName, *fsRadiiName;
- builder->addVarying(kVec2f_GrSLType, "EllipseOffsets", &vsOffsetName, &fsOffsetName);
+ vertexBuilder->addVarying(kVec2f_GrSLType, "EllipseOffsets", &vsOffsetName, &fsOffsetName);
const SkString* attr0Name =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
- builder->vsCodeAppendf("\t%s = %s;\n", vsOffsetName, attr0Name->c_str());
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsOffsetName, attr0Name->c_str());
- builder->addVarying(kVec4f_GrSLType, "EllipseRadii", &vsRadiiName, &fsRadiiName);
+ vertexBuilder->addVarying(kVec4f_GrSLType, "EllipseRadii", &vsRadiiName, &fsRadiiName);
const SkString* attr1Name =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[1]);
- builder->vsCodeAppendf("\t%s = %s;\n", vsRadiiName, attr1Name->c_str());
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[1]);
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsRadiiName, attr1Name->c_str());
// for outer curve
builder->fsCodeAppendf("\tvec2 scaledOffset = %s*%s.xy;\n", fsOffsetName, fsRadiiName);
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698