Detect macOS font smoothing behavior.

In macOS 14 the font smoothing behavior was changed. On macOS 13 and lower
requesting smoothing would either do nothing or apply fake bolding and
subpixel coverage, depending on a user setting. On macOS 14 this same user
setting causes smoothing to either do nothing or apply fake bolding. Skia
had been checking for subpixel coverage to know whether to ask for
smoothing, but since subpixel coverage is no longer provided Skia won't
ask for smoothing. However, some still want to see the fake bolding.

This changes behavior in Skia to detect if requesting smoothing does not
change the rendering, if it changes the rendering, or if it changes the
rendering and applies subpixel coverage. The code which conflated the
changing of rendering and subpixel coverage is updated to check for the
appropriate conditions.

This has the odd effect of making the setLCDRenderText setting in Skia on
macOS 14 not actually turn on subpixel coverage but instead apply
fake-bolding to closest match the behavior of the request on previous
versions of macOS.

Bug: chromium:858861
Change-Id: Ic7ff22e171a15be20e0bcccb10b0c4798cba8b72
Reviewed-on: https://skia-review.googlesource.com/157566
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
1 file changed