From 5592382a7ad13668f6b70be842948766f0c3a199 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Mon, 22 May 2017 16:34:34 -0400 Subject: 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 Commit-Queue: Greg Daniel --- src/gpu/effects/GrBitmapTextGeoProc.cpp | 6 ------ src/gpu/effects/GrDistanceFieldGeoProc.cpp | 15 ++++++--------- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'src/gpu/effects') 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, -- cgit v1.2.3