When guessing at the dest, use linear space instead of color space.
http://codereview.appspot.com/5732044/ --this line, and those below, will be ignored-- M src/ports/SkFontHost_FreeType.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@3313 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
c2099d2707
commit
d0b6a2dd82
@ -1068,7 +1068,7 @@ static void build_power_table(uint8_t table[], float ee) {
|
||||
}
|
||||
}
|
||||
|
||||
static void build_gamma_table(uint8_t table[256], int src, int dst) {
|
||||
static void build_gamma_table(uint8_t table[256], int src) {
|
||||
static bool gInit;
|
||||
static uint8_t powTable[256], invPowTable[256];
|
||||
if (!gInit) {
|
||||
@ -1079,7 +1079,9 @@ static void build_gamma_table(uint8_t table[256], int src, int dst) {
|
||||
}
|
||||
|
||||
const int linSrc = powTable[src];
|
||||
const int linDst = powTable[dst];
|
||||
const int linDst = 255 - linSrc;
|
||||
const int dst = invPowTable[linDst];
|
||||
|
||||
// have our contrast value taper off to 0 as the src luminance becomes white
|
||||
const int contrast = SK_GAMMA_CONTRAST * (255 - linSrc) / 255;
|
||||
|
||||
@ -1105,10 +1107,10 @@ static const uint8_t* getGammaTable(U8CPU luminance) {
|
||||
static uint8_t gGammaTables[4][256];
|
||||
static bool gInited;
|
||||
if (!gInited) {
|
||||
build_gamma_table(gGammaTables[0], 0x00, 0xFF);
|
||||
build_gamma_table(gGammaTables[1], 0x66, 0x99);
|
||||
build_gamma_table(gGammaTables[2], 0x99, 0x66);
|
||||
build_gamma_table(gGammaTables[3], 0xFF, 0x00);
|
||||
build_gamma_table(gGammaTables[0], 0x00);
|
||||
build_gamma_table(gGammaTables[1], 0x55);
|
||||
build_gamma_table(gGammaTables[2], 0xAA);
|
||||
build_gamma_table(gGammaTables[3], 0xFF);
|
||||
|
||||
gInited = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user