Tweak distance field path renderer behavior in gamma-correct mode to match
recent changes to text rendering.
Uses linear coverage falloff. Produces results that are perceptually more
similar to L32 (raster and gpu). Smoothstep + sRGB was too soft.
Plumb the gamma-correctness via DrawPathArgs, which also paves the way for
other path rendering implementations to easily make decisions about rendering
technique based on that flag.
Fix a few typos and formatting issues from my most recent change.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1889453002
Review URL: https://codereview.chromium.org/1889453002
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 9110b34..2e4b13f 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -922,6 +922,7 @@
args.fPath = &path;
args.fStroke = &GrStrokeInfo::FillInfo();
args.fAntiAlias = useCoverageAA;
+ args.fGammaCorrect = fDrawContext->isGammaCorrect();
pr->drawPath(args);
return true;
}
@@ -1025,6 +1026,7 @@
args.fPath = pathPtr;
args.fStroke = strokeInfoPtr;
args.fAntiAlias = useCoverageAA;
+ args.fGammaCorrect = this->isGammaCorrect();
pr->drawPath(args);
}