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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 14 08:36:45 PDT 2013


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





--- Comment #21 from Nico Weber <thakis at chromium.org>  2013-03-14 08:39:09 PST ---
(In reply to comment #20)
> 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.

third_party/WebKit/Source/WebCore/platform/graphics/skia/FontSkia.cpp has:

    if (!shouldUseSmoothing() || isRunningLayoutTest())
        shouldSmoothFonts = false;

This is later passed to

    paint->setLCDRenderText(shouldSmoothFonts);

which then makes its way to SkFontHost_mac into generateA8FromLCD as described above.

> 
> > > > 
> > > > 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.
> 
> [*snip*] So I'm not sure what is meant by 'only works for A8 pixels'.

I meant the if cited 4 lines above is only entered if SkMask::kA8_Format == glyph.fMaskFormat.

-- 
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