Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(88)

Issue 5431045: store n-bits of luminance in fontcache rec

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by reed1
Modified:
12 years, 5 months ago
Reviewers:
caryclark1, TomH
CC:
bsalomon, DerekS
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : update #

Patch Set 3 : update again #

Patch Set 4 : use 3 bits, but discretize in FilterRec #

Total comments: 2

Patch Set 5 : hardcode for bits==3 for now #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -51 lines) Patch
M include/core/SkScalerContext.h View 1 2 3 4 3 chunks +33 lines, -10 lines 0 comments Download
M src/core/SkPaint.cpp View 1 3 7 chunks +20 lines, -17 lines 0 comments Download
M src/ports/SkFontHost_FreeType.cpp View 1 2 3 5 chunks +41 lines, -14 lines 0 comments Download
M src/ports/SkFontHost_mac_coretext.cpp View 1 2 3 2 chunks +20 lines, -2 lines 0 comments Download
M src/ports/SkFontHost_win.cpp View 1 2 3 4 chunks +20 lines, -8 lines 0 comments Download

Messages

Total messages: 3
reed1
question: how can I better handle the logic in SkScalerContext.h getLuminanceByte() when I don't know ...
12 years, 5 months ago (2011-11-22 19:07:00 UTC) #1
TomH
On 2011/11/22 19:07:00, reed1 wrote: > question: how can I better handle the logic in ...
12 years, 5 months ago (2011-11-22 19:14:12 UTC) #2
caryclark1
12 years, 5 months ago (2011-11-22 20:07:47 UTC) #3
lgtm

http://codereview.appspot.com/5431045/diff/4001/include/core/SkScalerContext.h
File include/core/SkScalerContext.h (right):

http://codereview.appspot.com/5431045/diff/4001/include/core/SkScalerContext....
include/core/SkScalerContext.h:180: kLuminance_Bits           = 3,  // ensure
Flags doesn't exceed 16bits
Does the 'ensure...' comment mean there's a compile-time assert checking that
 kLuminance_Shift + kLuminance_Bits <= sizeof(fFlags) * 8
?

http://codereview.appspot.com/5431045/diff/4001/src/core/SkPaint.cpp
File src/core/SkPaint.cpp (right):

http://codereview.appspot.com/5431045/diff/4001/src/core/SkPaint.cpp#newcode1293
src/core/SkPaint.cpp:1293: int luminance = r * 2 + g * 5 + b;
Wikipedia's linear luminance from RGB is:
Y = 0.2126 R + 0.7152 G + 0.0722 B
Your x/8 approximates:
    0.25 R + 0.625 G + 0.125 B
Would x/16 be worth it? (4/11/1)>>1
    0.25 R + 0.6875 G + 0.0625 B

Worth a comment?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b