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

Unified Diff: src/effects/SkColorMatrixFilter.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/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index bb7dd94910176d022fd4c3e4e833c7c8356b3e4a..6e1c8ddb813d80de6b7b64e81f88a2c14dcf7053 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -419,19 +419,19 @@ public:
// could optimize this case, but we aren't for now.
args.fInputColor = "vec4(1)";
}
- GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
// The max() is to guard against 0 / 0 during unpremul when the incoming color is
// transparent black.
- fsBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n",
- args.fInputColor);
- fsBuilder->codeAppendf("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n",
- args.fOutputColor,
- args.fBuilder->getUniformCStr(fMatrixHandle),
- args.fInputColor,
- args.fBuilder->getUniformCStr(fVectorHandle));
- fsBuilder->codeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n",
- args.fOutputColor, args.fOutputColor);
- fsBuilder->codeAppendf("\t%s.rgb *= %s.a;\n", args.fOutputColor, args.fOutputColor);
+ fragBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n",
+ args.fInputColor);
+ fragBuilder->codeAppendf("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n",
+ args.fOutputColor,
+ args.fBuilder->getUniformCStr(fMatrixHandle),
+ args.fInputColor,
+ args.fBuilder->getUniformCStr(fVectorHandle));
+ fragBuilder->codeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n",
+ args.fOutputColor, args.fOutputColor);
+ fragBuilder->codeAppendf("\t%s.rgb *= %s.a;\n", args.fOutputColor, args.fOutputColor);
}
protected:
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698