Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Issue 1885613002: sRGB support for distance field text. (Closed)

Created:
4 years, 8 months ago by Brian Osman
Modified:
4 years, 8 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

sRGB support for distance field text. Add a second distance field adjust table that only applies contrast, not fake-gamma correction. Store a flag in the batch at creation time, using the same logic we apply elsewhere (render target format, plus paint flags). That gets us close, but not as good as bitmap text. The final step is to use a linear step function (rather than smoothstep) to map distance to coverage, when we have sRGB output. Smoothstep's nonlinear response is actually doing some fake-gamma, so it ends up over-correcting when the output is already gamma-correct. Results are now very close between L32 (old table, smoothstep) and S32 (contrast-only table, linstep). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885613002 Committed: https://skia.googlesource.com/skia/+/0586f5cc9713268238394411a5daa2c7758b092b

Patch Set 1 #

Patch Set 2 : Use linstep for srgb output #

Patch Set 3 : Break long line #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -26 lines) Patch
M src/gpu/batches/GrAtlasTextBatch.h View 3 chunks +3 lines, -0 lines 0 comments Download
M src/gpu/batches/GrAtlasTextBatch.cpp View 1 3 chunks +9 lines, -7 lines 0 comments Download
M src/gpu/effects/GrDistanceFieldGeoProc.h View 1 2 chunks +5 lines, -2 lines 0 comments Download
M src/gpu/effects/GrDistanceFieldGeoProc.cpp View 1 2 4 chunks +23 lines, -3 lines 2 comments Download
M src/gpu/text/GrAtlasTextBlob.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/text/GrAtlasTextBlob.cpp View 4 chunks +9 lines, -4 lines 0 comments Download
M src/gpu/text/GrDistanceFieldAdjustTable.h View 1 chunk +9 lines, -5 lines 0 comments Download
M src/gpu/text/GrDistanceFieldAdjustTable.cpp View 3 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
Brian Osman
4 years, 8 months ago (2016-04-12 18:56:13 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885613002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885613002/40001
4 years, 8 months ago (2016-04-12 19:15:34 UTC) #6
bsalomon
On 2016/04/12 19:15:34, commit-bot: I haz the power wrote: > Dry run: CQ is trying ...
4 years, 8 months ago (2016-04-12 19:21:21 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-12 19:29:45 UTC) #9
jvanverth1
lgtm + comment https://codereview.chromium.org/1885613002/diff/40001/src/gpu/effects/GrDistanceFieldGeoProc.cpp File src/gpu/effects/GrDistanceFieldGeoProc.cpp (right): https://codereview.chromium.org/1885613002/diff/40001/src/gpu/effects/GrDistanceFieldGeoProc.cpp#newcode404 src/gpu/effects/GrDistanceFieldGeoProc.cpp:404: fragBuilder->codeAppend("float val = smoothstep(-afwidth, afwidth, distance);"); ...
4 years, 8 months ago (2016-04-12 19:34:46 UTC) #10
Brian Osman
https://codereview.chromium.org/1885613002/diff/40001/src/gpu/effects/GrDistanceFieldGeoProc.cpp File src/gpu/effects/GrDistanceFieldGeoProc.cpp (right): https://codereview.chromium.org/1885613002/diff/40001/src/gpu/effects/GrDistanceFieldGeoProc.cpp#newcode404 src/gpu/effects/GrDistanceFieldGeoProc.cpp:404: fragBuilder->codeAppend("float val = smoothstep(-afwidth, afwidth, distance);"); On 2016/04/12 19:34:46, ...
4 years, 8 months ago (2016-04-12 19:46:00 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1885613002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1885613002/40001
4 years, 8 months ago (2016-04-12 19:47:26 UTC) #13
commit-bot: I haz the power
4 years, 8 months ago (2016-04-12 19:48:24 UTC) #15
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/0586f5cc9713268238394411a5daa2c7758b092b

Powered by Google App Engine
This is Rietveld 408576698