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

Issue 258883002: Gamma correction for distance field text. (Closed)

Created:
6 years, 8 months ago by jvanverth1
Modified:
6 years, 6 months ago
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Gamma correction for distance field text. Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance. BUG=skia: Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc Committed: https://skia.googlesource.com/skia/+/2d2a68c51b4a71bd60760510bf2b2e58bc9890b2

Patch Set 1 #

Patch Set 2 : Method using texture LUT #

Patch Set 3 : Rebase to ToT #

Patch Set 4 : Make sure we get a linear mask #

Patch Set 5 : Change accessor to LUT data to pass in correct gammas and contrast #

Patch Set 6 : Finally got gamma working #

Patch Set 7 : Rebase to ToT #

Patch Set 8 : Move gamma code to main LCDTextureEffect #

Patch Set 9 : Rebase #

Patch Set 10 : Tweak DF values for Windows #

Patch Set 11 : Fix for Linux #

Patch Set 12 : Add gamma support to grayscale text #

Patch Set 13 : Bug fixes for non-LCD text. #

Patch Set 14 : Some clean-up #

Patch Set 15 : Fix color setup. Some more clean-up. #

Patch Set 16 : Whitespace cleanup. #

Patch Set 17 : Move antialiasing factor into a #define #

Patch Set 18 : Add comments for the magic bold factor #

Total comments: 12

Patch Set 19 : Clean up LUT creation #

Patch Set 20 : Use the correct contrast value. Don't apply gamma to A8 unless necessary. #

Total comments: 2

Patch Set 21 : Rebase to ToT #

Patch Set 22 : Unref gamma texture #

Total comments: 6

Patch Set 23 : Don't use SkPaint distance field flag for filtering the ScalarContext::Rec; add getGammaLUT* commen… #

Total comments: 4

Patch Set 24 : Fix Window build; clean up comments and make GetGammaLUT* static. #

Patch Set 25 : Rebase to ToT #

Patch Set 26 : Fix SkAutoGlyphCache destructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+375 lines, -70 lines) Patch
M include/core/SkPaint.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +3 lines, -1 line 0 comments Download
M src/core/SkGlyphCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +53 lines, -16 lines 0 comments Download
M src/core/SkMaskGamma.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +16 lines, -0 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +34 lines, -8 lines 0 comments Download
M src/core/SkScalerContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +11 lines, -0 lines 0 comments Download
M src/gpu/GrDistanceFieldTextContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/GrDistanceFieldTextContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 9 chunks +82 lines, -9 lines 0 comments Download
M src/gpu/effects/GrDistanceFieldTextureEffect.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +34 lines, -6 lines 0 comments Download
M src/gpu/effects/GrDistanceFieldTextureEffect.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 17 chunks +141 lines, -30 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
jvanverth1
After testing on many platforms, I believe this is good to go. The part I'm ...
6 years, 6 months ago (2014-05-28 19:28:49 UTC) #1
reed1
https://codereview.chromium.org/258883002/diff/330001/src/core/SkMaskGamma.h File src/core/SkMaskGamma.h (right): https://codereview.chromium.org/258883002/diff/330001/src/core/SkMaskGamma.h#newcode143 src/core/SkMaskGamma.h:143: const uint8_t* getGammaTables(int& tableWidth, int& numTables) const { style: ...
6 years, 6 months ago (2014-05-28 19:45:16 UTC) #2
bsalomon
https://codereview.chromium.org/258883002/diff/330001/src/gpu/GrDistanceFieldTextContext.cpp File src/gpu/GrDistanceFieldTextContext.cpp (right): https://codereview.chromium.org/258883002/diff/330001/src/gpu/GrDistanceFieldTextContext.cpp#newcode38 src/gpu/GrDistanceFieldTextContext.cpp:38: GrTexture* gGammaTexture = NULL; This doesn't seem safe. There ...
6 years, 6 months ago (2014-05-28 19:53:53 UTC) #3
jvanverth1
https://codereview.chromium.org/258883002/diff/330001/src/core/SkMaskGamma.h File src/core/SkMaskGamma.h (right): https://codereview.chromium.org/258883002/diff/330001/src/core/SkMaskGamma.h#newcode143 src/core/SkMaskGamma.h:143: const uint8_t* getGammaTables(int& tableWidth, int& numTables) const { On ...
6 years, 6 months ago (2014-05-29 18:53:48 UTC) #4
jvanverth1
I realized that I didn't take into account the contrast value or whether gamma correction ...
6 years, 6 months ago (2014-05-30 18:20:27 UTC) #5
bsalomon
https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h File src/gpu/GrDistanceFieldTextContext.h (right): https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h#newcode37 src/gpu/GrDistanceFieldTextContext.h:37: GrTexture* fGammaTexture; Where does this get unreffed?
6 years, 6 months ago (2014-06-02 15:20:46 UTC) #6
jvanverth1
https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h File src/gpu/GrDistanceFieldTextContext.h (right): https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h#newcode37 src/gpu/GrDistanceFieldTextContext.h:37: GrTexture* fGammaTexture; On 2014/06/02 15:20:46, bsalomon wrote: > Where ...
6 years, 6 months ago (2014-06-03 19:24:58 UTC) #7
bsalomon
On 2014/06/03 19:24:58, jvanverth1 wrote: > https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h > File src/gpu/GrDistanceFieldTextContext.h (right): > > https://codereview.chromium.org/258883002/diff/370001/src/gpu/GrDistanceFieldTextContext.h#newcode37 > ...
6 years, 6 months ago (2014-06-03 19:30:31 UTC) #8
reed1
https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp#newcode1816 src/core/SkPaint.cpp:1816: if (paint.isDistanceFieldTextTEMP()) { What is the expected lifespan of ...
6 years, 6 months ago (2014-06-03 19:46:44 UTC) #9
jvanverth1
https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp#newcode1816 src/core/SkPaint.cpp:1816: if (paint.isDistanceFieldTextTEMP()) { On 2014/06/03 19:46:44, reed1 wrote: > ...
6 years, 6 months ago (2014-06-05 18:18:23 UTC) #10
jvanverth1
https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/258883002/diff/400001/src/core/SkPaint.cpp#newcode1816 src/core/SkPaint.cpp:1816: if (paint.isDistanceFieldTextTEMP()) { On 2014/06/05 18:18:23, jvanverth1 wrote: > ...
6 years, 6 months ago (2014-06-06 15:34:44 UTC) #11
jvanverth1
The CQ bit was checked by jvanverth@google.com
6 years, 6 months ago (2014-06-09 14:19:50 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/jvanverth@google.com/258883002/420001
6 years, 6 months ago (2014-06-09 14:20:11 UTC) #13
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: Build-Win7-VS2010-x86-Debug-Trybot on tryserver.chromium ...
6 years, 6 months ago (2014-06-09 14:41:22 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-09 14:59:54 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win7-VS2010-x86-Debug-Trybot on tryserver.chromium (http://108.170.220.76:10117/builders/Build-Win7-VS2010-x86-Debug-Trybot/builds/277)
6 years, 6 months ago (2014-06-09 14:59:55 UTC) #16
bungeman-skia
https://codereview.chromium.org/258883002/diff/420001/src/core/SkScalerContext.h File src/core/SkScalerContext.h (right): https://codereview.chromium.org/258883002/diff/420001/src/core/SkScalerContext.h#newcode189 src/core/SkScalerContext.h:189: size_t getGammaLUTSize(SkScalar contrast, SkScalar paintGamma, SkScalar deviceGamma, Can these ...
6 years, 6 months ago (2014-06-09 15:17:22 UTC) #17
jvanverth1
https://codereview.chromium.org/258883002/diff/420001/src/core/SkScalerContext.h File src/core/SkScalerContext.h (right): https://codereview.chromium.org/258883002/diff/420001/src/core/SkScalerContext.h#newcode189 src/core/SkScalerContext.h:189: size_t getGammaLUTSize(SkScalar contrast, SkScalar paintGamma, SkScalar deviceGamma, On 2014/06/09 ...
6 years, 6 months ago (2014-06-09 17:26:14 UTC) #18
jvanverth1
The CQ bit was checked by jvanverth@google.com
6 years, 6 months ago (2014-06-09 17:59:39 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/jvanverth@google.com/258883002/460001
6 years, 6 months ago (2014-06-09 18:00:13 UTC) #20
jvanverth1
The CQ bit was unchecked by jvanverth@google.com
6 years, 6 months ago (2014-06-09 18:09:15 UTC) #21
jvanverth1
The CQ bit was checked by jvanverth@google.com
6 years, 6 months ago (2014-06-09 19:04:17 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/jvanverth@google.com/258883002/460001
6 years, 6 months ago (2014-06-09 19:04:46 UTC) #23
commit-bot: I haz the power
Change committed as 4d517fdbb145cb95e5e935470df331e1b6667cfc
6 years, 6 months ago (2014-06-09 19:05:00 UTC) #24
scroggo
A revert of this CL has been created in https://codereview.chromium.org/323513005/ by scroggo@google.com. The reason for ...
6 years, 6 months ago (2014-06-09 20:01:45 UTC) #25
jvanverth1
The CQ bit was checked by jvanverth@google.com
6 years, 6 months ago (2014-06-10 13:22:34 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/jvanverth@google.com/258883002/480001
6 years, 6 months ago (2014-06-10 13:23:13 UTC) #27
commit-bot: I haz the power
6 years, 6 months ago (2014-06-10 13:43:01 UTC) #28
Message was sent while issue was closed.
Change committed as 2d2a68c51b4a71bd60760510bf2b2e58bc9890b2

Powered by Google App Engine
This is Rietveld 408576698