DescriptionMac: restore subpixel AA in the find bar when it doesn't have focus
After linking to the 10.10 SDK, the text in the find bar (Cmd+F) loses
its subpixel AA when the textfield doesn't have focus.
https://developer.apple.com/library/prerelease/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#10_8Layers
documents new logic for applications linked on 10.8 and higher.
Specifically, NSTextField now allows LCD font smoothing when the view is
layer-backed, but this will be disabled if AppKit can't find an opaque
ancestor view.
The findbar textfield cell isn't opaque (it has rounded corners), but
the background behind the text is always solid (even when a theme is
installed), so enabling AA is safe. In fact, this is true for all
StyledTextFieldCells, of which there are 2 (findbar and omnibox).
Share the "force-enable-AA" logic already in BlueLabelButton and
AutocompleteTextFieldCell that does this by adding
ui::ScopedCGContextSmoothFonts. Note AutocompleteTextFieldCell overrides
-[NSCell drawWithFrame:inView:] so doesn't inherit the fix from
StyledTextFieldCell.
BUG=535790
TBR=avi@chromium.org
TEST=On Mac (without a retina screen), press Cmd+F, type something, then
click the page to defocus. The text in the find bar should keep its font
smoothing.
Committed: https://crrev.com/96e79b2a53fddaac6040ca2e699c33fbdf44641c
Cr-Commit-Position: refs/heads/master@{#351022}
Patch Set 1 #Patch Set 2 : DISALLOW_COPY.etc #
Total comments: 6
Patch Set 3 : respond to comments #
Messages
Total messages: 15 (6 generated)
|