Index: src/gpu/gl/GrGLXferProcessor.cpp |
diff --git a/src/gpu/gl/GrGLXferProcessor.cpp b/src/gpu/gl/GrGLXferProcessor.cpp |
index c517381249ae77735346c5a050d026ab38467e20..657da41274af0d8f3a7e19c559340d79d7afa668 100644 |
--- a/src/gpu/gl/GrGLXferProcessor.cpp |
+++ b/src/gpu/gl/GrGLXferProcessor.cpp |
@@ -17,11 +17,14 @@ void GrGLXferProcessor::emitCode(const EmitArgs& args) { |
GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
- // We don't think any shaders actually output negative coverage, but just as a safety check |
- // for floating point precision errors we compare with <= here |
- fsBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {" |
- " discard;" |
- "}", args.fInputCoverage); |
+ if (args.fXP.readsCoverage()) { |
+ // We don't think any shaders actually output negative coverage, but just as a safety |
+ // check for floating point precision errors we compare with <= here |
+ fsBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {" |
+ " discard;" |
+ "}", args.fInputCoverage); |
+ } |
+ |
const char* dstColor = fsBuilder->dstColor(); |
const char* dstCopyTopLeftName; |