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

Unified Diff: src/effects/GrCircleBlurFragmentProcessor.cpp

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/core/SkLightingShader.cpp ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/GrCircleBlurFragmentProcessor.cpp
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp
index 7c87ca400742892e0a2199d48645fddce4be6a89..8c9d20492867dce404a94110663a1872c3710c2f 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/effects/GrCircleBlurFragmentProcessor.cpp
@@ -46,23 +46,23 @@ void GrGLCircleBlurFragmentProcessor::emitCode(EmitArgs& args) {
"data",
&dataName);
- GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
- const char *fragmentPos = fsBuilder->fragmentPosition();
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
+ const char *fragmentPos = fragBuilder->fragmentPosition();
if (args.fInputColor) {
- fsBuilder->codeAppendf("vec4 src=%s;", args.fInputColor);
+ fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor);
} else {
- fsBuilder->codeAppendf("vec4 src=vec4(1);");
+ fragBuilder->codeAppendf("vec4 src=vec4(1);");
}
- fsBuilder->codeAppendf("vec2 vec = %s.xy - %s.xy;", fragmentPos, dataName);
- fsBuilder->codeAppendf("float dist = (length(vec) - %s.z + 0.5) / %s.w;", dataName, dataName);
+ fragBuilder->codeAppendf("vec2 vec = %s.xy - %s.xy;", fragmentPos, dataName);
+ fragBuilder->codeAppendf("float dist = (length(vec) - %s.z + 0.5) / %s.w;", dataName, dataName);
- fsBuilder->codeAppendf("float intensity = ");
- fsBuilder->appendTextureLookup(args.fSamplers[0], "vec2(dist, 0.5)");
- fsBuilder->codeAppend(".a;");
+ fragBuilder->codeAppendf("float intensity = ");
+ fragBuilder->appendTextureLookup(args.fSamplers[0], "vec2(dist, 0.5)");
+ fragBuilder->codeAppend(".a;");
- fsBuilder->codeAppendf("%s = src * intensity;\n", args.fOutputColor );
+ fragBuilder->codeAppendf("%s = src * intensity;\n", args.fOutputColor );
}
void GrGLCircleBlurFragmentProcessor::onSetData(const GrGLSLProgramDataManager& pdman,
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698