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

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

Issue 1341853002: Test that GrFragmentProcessors work without input colors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update more FPs Created 5 years, 3 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/GrConstColorProcessor.cpp ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp b/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
index c5ee9b8571c285c9b44572fe252c343dbf8fcd8b..8f6af65ca77be81034ab62d8c8f906f5b107a435 100644
--- a/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
+++ b/src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp
@@ -14,9 +14,13 @@ public:
GLExtractAlphaFragmentProcessor() {}
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
- fsBuilder->codeAppendf("vec4 alpha4 = %s.aaaa;", args.fInputColor);
- this->emitChild(0, "alpha4", args.fOutputColor, args);
+ if (args.fInputColor) {
+ GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ fsBuilder->codeAppendf("vec4 alpha4 = %s.aaaa;", args.fInputColor);
+ this->emitChild(0, "alpha4", args.fOutputColor, args);
+ } else {
+ this->emitChild(0, nullptr, args.fOutputColor, args);
+ }
}
private:
« no previous file with comments | « src/gpu/effects/GrConstColorProcessor.cpp ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698