Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Issue 2085623006: [merge-m52] Do not SchedulePaint() inside views::Label::OnPaint() (Closed)

Created:
4 years, 6 months ago by tapted
Modified:
4 years, 6 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2743
Target Ref:
refs/pending/branch-heads/2743
Project:
chromium
Visibility:
Public.

Description

[merge-m52] Do 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. Review-Url: https://codereview.chromium.org/2065003002 Cr-Commit-Position: refs/heads/master@{#400273} (cherry picked from commit 2b40c5ca82b21f503cc7cc75ac101f1d2b710fc1) Committed: https://chromium.googlesource.com/chromium/src/+/1812ed000f950a01a19e12f0bc3dfdc5b1642724

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -8 lines) Patch
M ui/views/controls/label.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/controls/label.cc View 4 chunks +8 lines, -3 lines 0 comments Download
M ui/views/controls/label_unittest.cc View 5 chunks +68 lines, -5 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
tapted
4 years, 6 months ago (2016-06-21 11:59:33 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
1812ed000f950a01a19e12f0bc3dfdc5b1642724.

Powered by Google App Engine
This is Rietveld 408576698