diff options
author | brianosman <brianosman@google.com> | 2016-04-13 13:56:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-13 13:56:21 -0700 |
commit | 0e3c55431b463b5575983c0c875909e08a3562bf (patch) | |
tree | 4aa76104cefbbbf35f6ba57a90bb0824ce59ed5e /src/gpu/GrPathRenderer.h | |
parent | d3b63d3244add67b1d087123f36a418f7fd7ec0f (diff) |
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
Diffstat (limited to 'src/gpu/GrPathRenderer.h')
-rw-r--r-- | src/gpu/GrPathRenderer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index 85b3275e89..cc149061ed 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -119,6 +119,7 @@ public: * fPath the path to draw. * fStroke the stroke information (width, join, cap) * fAntiAlias true if anti-aliasing is required. + * fGammaCorrect true if gamma-correct rendering is to be used. */ struct DrawPathArgs { GrDrawTarget* fTarget; @@ -129,6 +130,7 @@ public: const SkPath* fPath; const GrStrokeInfo* fStroke; bool fAntiAlias; + bool fGammaCorrect; void validate() const { SkASSERT(fTarget); @@ -281,6 +283,7 @@ private: drawArgs.fPath = args.fPath; drawArgs.fStroke = args.fStroke; drawArgs.fAntiAlias = false; + drawArgs.fGammaCorrect = false; this->drawPath(drawArgs); } |