discard when coverage is <= 0 in XP dst copy.
Darken was 5-20% slower with this CL, though it might improve things a bit to only look at one component of the vector. BUG=skia: Review URL: https://codereview.chromium.org/915633002
This commit is contained in:
parent
4e65473069
commit
043e0f60f4
@ -16,6 +16,12 @@ void GrGLXferProcessor::emitCode(const EmitArgs& args) {
|
||||
bool topDown = kTopLeft_GrSurfaceOrigin == args.fXP.getDstCopyTexture()->origin();
|
||||
|
||||
GrGLFPFragmentBuilder* 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);
|
||||
const char* dstColor = fsBuilder->dstColor();
|
||||
|
||||
const char* dstCopyTopLeftName;
|
||||
|
Loading…
Reference in New Issue
Block a user