aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrBitmapTextGeoProc.cpp6
-rw-r--r--src/gpu/effects/GrDistanceFieldGeoProc.cpp15
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,