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: |