Skip to content

Commit

Permalink
Bug 1322897. Use only the G channel for grayscale AA Dwrite fonts and…
Browse files Browse the repository at this point in the history
… Skia. r=lsalzman
  • Loading branch information
Mason Chang committed Feb 1, 2017
1 parent 83c8328 commit 189cf8b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,13 @@ static void rgb_to_a8(const uint8_t* SK_RESTRICT src, const SkGlyph& glyph, cons

for (U16CPU y = 0; y < glyph.fHeight; y++) {
for (U16CPU i = 0; i < width; i++) {
U8CPU r = *(src++);
U8CPU g = *(src++);
U8CPU b = *(src++);
dst[i] = sk_apply_lut_if<APPLY_PREBLEND>((r + g + b) / 3, table8);
U8CPU g = src[1];
src += 3;

// Ignore the R, B channels. It looks the closest to what
// D2D with grayscale AA has. But there's no way
// to just get a grayscale AA alpha texture from a glyph run.
dst[i] = sk_apply_lut_if<APPLY_PREBLEND>(g, table8);
}
dst = (uint8_t*)((char*)dst + dstRB);
}
Expand Down

0 comments on commit 189cf8b

Please sign in to comment.