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

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

Issue 491673002: Initial refactor of shaderbuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomCoordsTextureEffect.cpp
diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
index d235d5fb76a4655347c6724e931d716f01bedf7b..0401c6c7ef22425654dae40ce1cfb3134a86aeaa 100644
--- a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
+++ b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
@@ -5,9 +5,9 @@
* found in the LICENSE file.
*/
+#include "gl/builders/GrGLProgramBuilder.h"
#include "GrCustomCoordsTextureEffect.h"
#include "gl/GrGLEffect.h"
-#include "gl/GrGLShaderBuilder.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLVertexEffect.h"
@@ -19,7 +19,7 @@ public:
GrGLCustomCoordsTextureEffect(const GrBackendEffectFactory& factory, const GrDrawEffect& drawEffect)
: INHERITED (factory) {}
- virtual void emitCode(GrGLFullShaderBuilder* builder,
+ virtual void emitCode(GrGLFullProgramBuilder* builder,
const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
@@ -34,16 +34,18 @@ public:
builder->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsVaryingNamePtr);
fsCoordName = fsVaryingNamePtr;
- const char* attrName =
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0])->c_str();
- builder->vsCodeAppendf("\t%s = %s;\n", vsVaryingName, attrName);
+ GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
+ const SkString* attr0Name =
+ vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]);
+ vsBuilder->codeAppendf("\t%s = %s;\n", vsVaryingName, attr0Name->c_str());
- builder->fsCodeAppendf("\t%s = ", outputColor);
- builder->fsAppendTextureLookupAndModulate(inputColor,
+ GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ fsBuilder->codeAppendf("\t%s = ", outputColor);
+ fsBuilder->appendTextureLookupAndModulate(inputColor,
samplers[0],
fsCoordName.c_str(),
kVec2f_GrSLType);
- builder->fsCodeAppend(";\n");
+ fsBuilder->codeAppend(";\n");
}
virtual void setData(const GrGLProgramDataManager& pdman,
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698