[Webkit-unassigned] [Bug 100551] turn off text antialiasing by default for Chromium Mac DRT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 13 21:32:24 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=100551





--- Comment #20 from bungeman at chromium.org  2013-03-13 21:34:49 PST ---
So I'm rather confused by some of the statements here and will add my two cents.

(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #12)
> > > Turns out skia does turn off lcd antialiasing in SkFontHost_mac_coretext if layout test mode is set, see https://codereview.chromium.org/12316132 and https://bugs.webkit.org/show_bug.cgi?id=110890
> > > 
> > > So at least on Mac, we probably don't want to do this (since skia already does it). This might be true on linux too.

I'm not sure what this means? Skia itself has no particular notion of layout test mode, it just draws what it can. Note that on Mac when AppleFontSmoothing is set to 0 (none) CoreGraphics doesn't draw anything with lcd antialiasing, even if specifically requested. So with this setting you aren't going to get lcd smoothing unless you do it yourself (which we currently don't). Note that other platforms (GDI, FreeType, DirectWrite) don't care about any magic system setting and will do what they're asked.

> > > 
> > > Text pixel baselines on mac seem to match on 10.6, .7, and .8.
> > 
> > We get different behavior on Mountain Lion if the test sets -webkit-font-smoothing: none.  We've seen on some tests the edges of Ahem glyphs look different.
> 
> In third_party/skia/src/ports/SkFontHost_mac.cpp: Offscreen::getCG(), the parameter generateA8FromLCD
>  is effectively set in layout test mode. The function has this test:
> 
>     // FIXME: lcd smoothed un-hinted rasterization unsupported.
>     if (!generateA8FromLCD && SkMask::kA8_Format == glyph.fMaskFormat) {
>         doLCD = false;
>         doAA = true;
>     }
> 
> So skia's stuff only works for A8 pixels. -webkit-font-smoothing probably switches glyphs to something else.

-webkit-font-smoothing:antialiased just sets the Skia hinting to 'none', because no one seriously uses it to prevent lcd antialiasing, they set it to get glyphs which haven't had their outlines dilated on Mac (AppleFontSmoothing 1-3 determines which hard-coded dilation percentages to use). CoreGraphics will never produce lcd smoothed glyph rasterizations from un-dilated outlines. Once we get an actual lcd filter into SkScalerContext we can support this by just rasterizing the un-dilated outlines ourselves. Note that generateA8FromLCD just means have CoreGraphics render the lcd smoothed glyph (from its magically dilated outlines) and then back-form an A8 mask from that. So I'm not sure what is meant by 'only works for A8 pixels'.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list