Chromium Code Reviews
DescriptionDo not SchedulePaint() inside views::Label::OnPaint()
View::SchedulePaint() shouldn't be called inside an OnPaint() method. At
best it wastes computation doing a follow-up, redundant paint. On Mac
it's causing a weird interaction with transparent backgrounds for
strings of particular lengths on retina screens.
For performance, MaybeBuildRenderTextLines() is always deferred until a
Paint. It calls RecalculateColors() to apply colors to the lines it
newly creates, and that schedules a paint. But
MaybeBuildRenderTextLines() just needs to apply the colors that have
already been calculated.
So, to fix, split RecalculateColors() into the color calculation and
ApplyTextColors(), which can be called from OnPaint().
BUG=604092
TEST=On a retina-screen Mac with a fresh profile, navigate (e.g. to
chrome://version), then press Backspace, The "Press <key> to go back"
popup should appear and it should have a consistent, transparent
background.
Committed: https://crrev.com/2b40c5ca82b21f503cc7cc75ac101f1d2b710fc1
Cr-Commit-Position: refs/heads/master@{#400273}
Patch Set 1 : Feeds through a bool `in_paint` #Patch Set 2 : Nicer fix (also fix hypothetical GetFocusBounds) #Patch Set 3 : call super::OnEnabledChanged() #
Total comments: 2
Patch Set 4 : Add a test #
Messages
Total messages: 15 (10 generated)
|
|||||||||||||||||||||||||||||||||||||