diff options
author | Greg Daniel <egdaniel@google.com> | 2017-05-22 16:34:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-22 21:03:37 +0000 |
commit | 5592382a7ad13668f6b70be842948766f0c3a199 (patch) | |
tree | 0c914f3453754edf3c6ab0cb00cfbc1f78bfb820 /src/gpu/effects | |
parent | 8793e3889833a3de18254cd8a147e213ec98b7fc (diff) |
Remove setting of alpha coverage in text ops when in LCD mode
Bug: skia:
Change-Id: I0e320497fe72a0edad7bda7ea1c34dc2f713fc56
Reviewed-on: https://skia-review.googlesource.com/17530
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrDistanceFieldGeoProc.cpp | 15 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index 470af46783..cd2fe563d1 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -72,12 +72,6 @@ public: fragBuilder->codeAppendf("%s = ", args.fOutputCoverage); fragBuilder->appendTextureLookup(args.fTexSamplers[0], v.fsIn(), kVec2f_GrSLType); fragBuilder->codeAppend(";"); - if (cte.maskFormat() == kA565_GrMaskFormat) { - // set alpha to be max of rgb coverage - fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", - args.fOutputCoverage, args.fOutputCoverage, - args.fOutputCoverage, args.fOutputCoverage); - } } } diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index 96d322f0f9..7d22ad37fa 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -712,17 +712,14 @@ public: // doing gamma-correct rendering (to an sRGB or F16 buffer), then we actually want distance // mapped linearly to coverage, so use a linear step: if (isGammaCorrect) { - fragBuilder->codeAppend("vec4 val = " - "vec4(clamp((distance + vec3(afwidth)) / vec3(2.0 * afwidth), 0.0, 1.0), 1.0);"); + fragBuilder->codeAppendf("%s = " + "vec4(clamp((distance + vec3(afwidth)) / vec3(2.0 * afwidth), 0.0, 1.0), 1.0);", + args.fOutputCoverage); } else { - fragBuilder->codeAppend( - "vec4 val = vec4(smoothstep(vec3(-afwidth), vec3(afwidth), distance), 1.0);"); + fragBuilder->codeAppendf( + "%s = vec4(smoothstep(vec3(-afwidth), vec3(afwidth), distance), 1.0);", + args.fOutputCoverage); } - - // set alpha to be max of rgb coverage - fragBuilder->codeAppend("val.a = max(max(val.r, val.g), val.b);"); - - fragBuilder->codeAppendf("%s = val;", args.fOutputCoverage); } void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& processor, |