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

Issue 1461673002: Moved parent_->SchedulePaint() to Views::SetFillsBoundsOpaquely() and Views::SchedulePaint(). (Closed)

Created:
5 years, 1 month ago by bruthig
Modified:
4 years, 11 months ago
Reviewers:
jonross, sadrul, sky
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL fixes a more general issue in Views that had a quick fix that landed here: https://codereview.chromium.org/1460733002/ The general problem is that the layer owned by a parent View can become dirty/stale when a child view is painting to it's own layer. This CL fixes the problem by scheduling paints on the parent view when it may be dirty. BUG=551492, 546683 TEST=ViewLayerTest.NoCrashWhenParentlessViewSchedulesPaintOnParent ViewLayerTest.ScheduledRectsInParentAfterSchedulingPaint ViewLayerTest.ParentPaintWhenSwitchingPaintToLayerFromFalseToTrue ViewLayerTest.NoParentPaintWhenSwitchingPaintToLayerFromTrueToTrue Committed: https://crrev.com/c8761106916aac604f30fb2223cdbfb2bd3ffda3 Cr-Commit-Position: refs/heads/master@{#367536}

Patch Set 1 #

Patch Set 2 : Fixed the diff base. #

Patch Set 3 : Removed parent()->SchedulePaint() from ToolbarButton::AddInkDropLayer(). #

Total comments: 3

Patch Set 4 : Changed View to schedule a parent paint only when paint to layer, or fills bounds opaquely changed. #

Total comments: 4

Patch Set 5 : Added ViewTests that confirm a paint was scheduled on the parent. #

Patch Set 6 : Added ViewLayerTests to check paints scheduled on the parent. #

Total comments: 4

Patch Set 7 : Moved SchedulePaintOnParent() call to CreateLayer(). #

Patch Set 8 : Changed doc comment in View::CreateLayer(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -4 lines) Patch
M chrome/browser/ui/views/toolbar/toolbar_button.cc View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/view.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 5 6 7 2 chunks +14 lines, -0 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 5 6 2 chunks +47 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (10 generated)
jonross
https://codereview.chromium.org/1461673002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/40001/ui/views/view.cc#newcode730 ui/views/view.cc:730: if (parent_ && (!layer() || !layer()->fills_bounds_opaquely())) { This will ...
5 years, 1 month ago (2015-11-18 16:55:45 UTC) #4
bruthig
https://codereview.chromium.org/1461673002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/40001/ui/views/view.cc#newcode730 ui/views/view.cc:730: if (parent_ && (!layer() || !layer()->fills_bounds_opaquely())) { On 2015/11/18 ...
5 years, 1 month ago (2015-11-18 17:02:48 UTC) #5
bruthig
jonross@, I've updated the CL to only schedule paints on the parent when "paint to ...
5 years, 1 month ago (2015-11-18 17:46:43 UTC) #6
jonross
On 2015/11/18 17:46:43, bruthig wrote: > jonross@, I've updated the CL to only schedule paints ...
5 years, 1 month ago (2015-11-18 18:37:22 UTC) #7
sadrul
+sky@ Looks good in general. Can this have a test?
5 years, 1 month ago (2015-11-19 22:26:16 UTC) #9
sky
https://codereview.chromium.org/1461673002/diff/60001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/60001/ui/views/view.cc#newcode464 ui/views/view.cc:464: SchedulePaintOnParent(); Why does this case necessitate a paint on ...
5 years, 1 month ago (2015-11-19 22:31:49 UTC) #10
sky
And agree with Sadrul that test coverage would be nice.
5 years, 1 month ago (2015-11-19 22:32:06 UTC) #11
bruthig
I have added some tests. sky@, sadrul@ can you PTAL? https://codereview.chromium.org/1461673002/diff/60001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/60001/ui/views/view.cc#newcode464 ...
4 years, 12 months ago (2015-12-22 22:32:40 UTC) #13
sky
https://codereview.chromium.org/1461673002/diff/100001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/100001/ui/views/view.cc#newcode472 ui/views/view.cc:472: SchedulePaintOnParent(); I think you should move this to CreateLayer, ...
4 years, 11 months ago (2015-12-27 23:55:04 UTC) #14
bruthig
sky@, PTAL https://codereview.chromium.org/1461673002/diff/100001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1461673002/diff/100001/ui/views/view.cc#newcode472 ui/views/view.cc:472: SchedulePaintOnParent(); On 2015/12/27 23:55:04, sky wrote: > ...
4 years, 11 months ago (2016-01-04 19:00:15 UTC) #15
bruthig
sky@, PTAL
4 years, 11 months ago (2016-01-04 21:48:45 UTC) #17
sky
LGTM - thanks for the comment!
4 years, 11 months ago (2016-01-04 22:45:57 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1461673002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1461673002/140001
4 years, 11 months ago (2016-01-05 15:08:49 UTC) #21
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 11 months ago (2016-01-05 15:47:21 UTC) #23
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/c8761106916aac604f30fb2223cdbfb2bd3ffda3 Cr-Commit-Position: refs/heads/master@{#367536}
4 years, 11 months ago (2016-01-05 15:48:21 UTC) #25
Ken Rockot(use gerrit already)
A revert of this CL (patchset #8 id:140001) has been created in https://codereview.chromium.org/1560723002/ by rockot@chromium.org. ...
4 years, 11 months ago (2016-01-05 17:41:42 UTC) #26
bruthig
4 years, 11 months ago (2016-01-06 16:37:33 UTC) #27
Message was sent while issue was closed.
Re-landed here: https://codereview.chromium.org/1566693002/

Powered by Google App Engine
This is Rietveld 408576698