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

Issue 996453002: Allow ui::Compositor to disable commits during tab-switch (Closed)

Created:
5 years, 9 months ago by ccameron
Modified:
5 years, 9 months ago
Reviewers:
danakj, weiliangc
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, Ian Vollick, jam, penghuang+watch_chromium.org, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, cc-bugs_chromium.org, James Su, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow ui::Compositor to defer commits during tab-switch Do this by using a ui::CompositorLock. For Mac, we don't care about making sure that the compositor doesn't hang waiting for renderer frames (because the browser compositor doesn't draw the UI), so disable the lock timeout. Also, re-create the browser compositor immediately after the tab is made visible. This way, if the DelegatedFrameHost has an un-evicted old frame, then that frame will be displayed immediately (and if not, the compositor will remain locked until a new frame is swapped in). Background: When we switched the ui::Compositor to use the scheduler (done in https://codereview.chromium.org/638653003), we started hitting issues where unexpected frames would flash on Mac during tab-switch. The reason for this is that, prior to the change, calling SetRootLayer(null) on the ui::Compositor would prevent it from drawing any new frames. The Mac was relying on this behavior to prevent transient frames from appearing. The transient frames appear during tab-switch on Mac because the compositor takes damage (as its root layer is changed) and also because the compositor is resized (among potentially other things). These frames do not actually appear on-screen (there are mechanisms to prevent this), but they waste valuable time during tab-switch (the browser allows only 50 msec for a new frame to appear on-screen before it flashes white, and this extra unused frame causes us to miss the deadline). With this patch, the frequency of the white flash during tab-switch is reduced substantially. BUG=463988 Committed: https://crrev.com/00e438cd22c5e2f26d003c15c0a1621aa24acd0c Cr-Commit-Position: refs/heads/master@{#320241}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use DeferCommits instead #

Total comments: 6

Patch Set 3 : Use compositor lock instead #

Patch Set 4 : Cleaned up version #

Total comments: 9

Patch Set 5 : Incorporate review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -16 lines) Patch
M cc/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/cc.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/proxy.h View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/compositor/browser_compositor_view_mac.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/compositor/browser_compositor_view_mac.mm View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 3 chunks +17 lines, -0 lines 0 comments Download
M ui/compositor/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/compositor/compositor.h View 1 2 3 chunks +11 lines, -4 lines 0 comments Download
M ui/compositor/compositor.cc View 1 2 3 chunks +7 lines, -9 lines 0 comments Download
M ui/compositor/compositor.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A ui/compositor/compositor_unittest.cc View 1 2 1 chunk +64 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (2 generated)
ccameron
LMK if this is even a reasonable thing to consider doing (in the context of ...
5 years, 9 months ago (2015-03-09 20:20:03 UTC) #2
danakj
On 2015/03/09 20:20:03, ccameron wrote: > LMK if this is even a reasonable thing to ...
5 years, 9 months ago (2015-03-10 17:23:58 UTC) #3
danakj
Why not use DeferCommits?
5 years, 9 months ago (2015-03-10 17:25:43 UTC) #4
ccameron
On 2015/03/10 17:25:43, danakj wrote: > Why not use DeferCommits? That's the path that said ...
5 years, 9 months ago (2015-03-11 00:28:49 UTC) #5
danakj
https://codereview.chromium.org/996453002/diff/20001/cc/trees/proxy.h File cc/trees/proxy.h (right): https://codereview.chromium.org/996453002/diff/20001/cc/trees/proxy.h#newcode84 cc/trees/proxy.h:84: // scheduler. It's an error to make a sync ...
5 years, 9 months ago (2015-03-11 17:22:55 UTC) #6
danakj
https://codereview.chromium.org/996453002/diff/20001/cc/BUILD.gn File cc/BUILD.gn (right): https://codereview.chromium.org/996453002/diff/20001/cc/BUILD.gn#newcode516 cc/BUILD.gn:516: "trees/layer_tree_host_single_thread_client.h", Looks like these buildfile changes aren't needed anymore
5 years, 9 months ago (2015-03-11 17:23:12 UTC) #7
ccameron
Update to use the ui::CompositorLock. I added a mode where you can tell the compositor ...
5 years, 9 months ago (2015-03-11 21:46:43 UTC) #8
danakj
Cool! I'm glad this is working nicely https://codereview.chromium.org/996453002/diff/60001/content/browser/compositor/browser_compositor_view_mac.mm File content/browser/compositor/browser_compositor_view_mac.mm (right): https://codereview.chromium.org/996453002/diff/60001/content/browser/compositor/browser_compositor_view_mac.mm#newcode50 content/browser/compositor/browser_compositor_view_mac.mm:50: compositor_suspended_lock_ = ...
5 years, 9 months ago (2015-03-12 00:07:15 UTC) #9
ccameron
Thanks -- updated. Let me know what you'd like to do about the lock behavior ...
5 years, 9 months ago (2015-03-12 01:01:35 UTC) #10
danakj
LGTM https://codereview.chromium.org/996453002/diff/60001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://codereview.chromium.org/996453002/diff/60001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode848 content/browser/renderer_host/render_widget_host_view_mac.mm:848: EnsureBrowserCompositorView(); On 2015/03/12 01:01:34, ccameron wrote: > On ...
5 years, 9 months ago (2015-03-12 01:08:50 UTC) #11
ccameron
Thanks!
5 years, 9 months ago (2015-03-12 05:41:35 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/996453002/80001
5 years, 9 months ago (2015-03-12 05:41:50 UTC) #14
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 9 months ago (2015-03-12 06:18:21 UTC) #15
commit-bot: I haz the power
5 years, 9 months ago (2015-03-12 06:18:47 UTC) #16
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/00e438cd22c5e2f26d003c15c0a1621aa24acd0c
Cr-Commit-Position: refs/heads/master@{#320241}

Powered by Google App Engine
This is Rietveld 408576698