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

Issue 60513007: Add SwapPromise support to LayerTreeHost and LayerTreeImpl (Closed)

Created:
7 years, 1 month ago by Yufeng Shen (Slow to review)
Modified:
7 years ago
Reviewers:
danakj, jamesr, nduca, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, Rick Byers
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add SwapPromise support to LayerTreeHost and LayerTreeImpl When a change to the compositor's state/invalidation/whatever happens, a Swap Promise can be inserted into LayerTreeHost/LayerTreeImpl, to track whether the compositor's reply to the new state/invaliadtion/whatever is completed in the compositor, i.e. the compositor knows it has been sent to its output or not. If the new compositor state is sent to the output, SwapPromise::DidSwap() will be called, and if the compositor fails to send its new state to the output, e.g. commit fails on main thread, new frame data has no actual damage so LayerTreeHostImpl::SwapBuffers() bails out early, then Promise::DidNotSwap() will be called. BUG=246034, 271583 TEST=unittests pass. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=237444

Patch Set 1 #

Patch Set 2 : Add comments for when to use QueueSwapPromise() #

Total comments: 14

Patch Set 3 : rework SwapPromise() interface to have virtual DidSwap() & DidNotSwap() interface #

Total comments: 50

Patch Set 4 : address Dana's comments #

Total comments: 1

Patch Set 5 : rename TakeSwapPromises to PassSwapPromises & remove 'type' from SwapPromise #

Patch Set 6 : remove SwapPromiseType #

Patch Set 7 : check NULL SwapPromise* before using it #

Patch Set 8 : Remove FinishSwapPromise from LTH; Add lock to TestSwapPromiseResult #

Patch Set 9 : Resubmit : Remove FinishSwapPromise from LTH; Add lock to TestSwapPromiseResult #

Patch Set 10 : resubmit again #

Patch Set 11 : rebase & reupload #

Patch Set 12 : fix typo #

Total comments: 2

Patch Set 13 : DCHECK(swap_promise_list_[i]) before dereference #

Total comments: 4

Patch Set 14 : Move DCHECK of NULL SwapPromise into QueueSwapPromise() #

Total comments: 4

Patch Set 15 : no .get() on scoped_ptr for DCHECK #

Patch Set 16 : add OVERRIDE to TestSwapPromise::DidNotSwap #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -1 line) Patch
A cc/base/swap_promise.h View 1 2 3 4 5 1 chunk +48 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/layer_tree_test.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +18 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +121 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +13 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +29 lines, -0 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
Yufeng Shen (Slow to review)
7 years, 1 month ago (2013-11-06 02:17:38 UTC) #1
enne (OOO)
How does this compare with LayerTreeHost::SetNextCommitForcesRedraw?
7 years, 1 month ago (2013-11-06 18:11:56 UTC) #2
Yufeng Shen (Slow to review)
On 2013/11/06 18:11:56, enne wrote: > How does this compare with LayerTreeHost::SetNextCommitForcesRedraw? I am not ...
7 years, 1 month ago (2013-11-06 19:09:39 UTC) #3
Yufeng Shen (Slow to review)
On 2013/11/06 19:09:39, Yufeng Shen wrote: > On 2013/11/06 18:11:56, enne wrote: > > How ...
7 years, 1 month ago (2013-11-07 21:54:09 UTC) #4
jamesr
Can you specify the contract for this interface in the code? The comment in the ...
7 years, 1 month ago (2013-11-07 22:03:13 UTC) #5
Yufeng Shen (Slow to review)
On 2013/11/07 22:03:13, jamesr wrote: > Can you specify the contract for this interface in ...
7 years, 1 month ago (2013-11-07 22:31:25 UTC) #6
jamesr
I'm having trouble imagining how client code could use this, especially given the somewhat confusing ...
7 years, 1 month ago (2013-11-12 03:15:04 UTC) #7
Yufeng Shen (Slow to review)
On 2013/11/12 03:15:04, jamesr wrote: > I'm having trouble imagining how client code could use ...
7 years, 1 month ago (2013-11-13 21:04:52 UTC) #8
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/70001/cc/base/swap_promise.h File cc/base/swap_promise.h (right): https://codereview.chromium.org/60513007/diff/70001/cc/base/swap_promise.h#newcode24 cc/base/swap_promise.h:24: base::Callback<void(const std::string&)> swap_aborted_callback; On 2013/11/12 03:15:04, jamesr wrote: > ...
7 years, 1 month ago (2013-11-13 21:05:04 UTC) #9
danakj
https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h File cc/base/swap_promise.h (right): https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h#newcode12 cc/base/swap_promise.h:12: // A SwapPromise can be queued into LTH/LTI to ...
7 years, 1 month ago (2013-11-13 23:22:07 UTC) #10
danakj
https://codereview.chromium.org/60513007/diff/140001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/60513007/diff/140001/cc/trees/thread_proxy.cc#newcode44 cc/trees/thread_proxy.cc:44: if (layer_tree_host_->HasQueuedSwapPromise()) Do you even need this? You could ...
7 years, 1 month ago (2013-11-13 23:23:35 UTC) #11
danakj
Since the SwapPromise can live on either thread, would it make sense to have the ...
7 years, 1 month ago (2013-11-13 23:25:22 UTC) #12
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h File cc/base/swap_promise.h (right): https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h#newcode12 cc/base/swap_promise.h:12: // A SwapPromise can be queued into LTH/LTI to ...
7 years, 1 month ago (2013-11-14 22:09:54 UTC) #13
Yufeng Shen (Slow to review)
On 2013/11/13 23:25:22, danakj wrote: > Since the SwapPromise can live on either thread, would ...
7 years, 1 month ago (2013-11-14 22:27:41 UTC) #14
danakj
https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h File cc/base/swap_promise.h (right): https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h#newcode38 cc/base/swap_promise.h:38: SwapPromiseType type() { On 2013/11/14 22:09:55, Yufeng Shen wrote: ...
7 years, 1 month ago (2013-11-20 03:00:55 UTC) #15
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h File cc/base/swap_promise.h (right): https://codereview.chromium.org/60513007/diff/140001/cc/base/swap_promise.h#newcode38 cc/base/swap_promise.h:38: SwapPromiseType type() { On 2013/11/20 03:00:55, danakj wrote: > ...
7 years, 1 month ago (2013-11-20 19:15:40 UTC) #16
danakj1
In LTH.h and LTImpl.h, I think mentioning that LTH/I takes ownership of the SwapPromise is ...
7 years, 1 month ago (2013-11-22 08:33:07 UTC) #17
Yufeng Shen (Slow to review)
On 2013/11/22 08:33:07, danakj1 wrote: > In LTH.h and LTImpl.h, I think mentioning that LTH/I ...
7 years, 1 month ago (2013-11-22 20:40:19 UTC) #18
danakj
https://codereview.chromium.org/60513007/diff/870001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/870001/cc/trees/layer_tree_host.cc#newcode1284 cc/trees/layer_tree_host.cc:1284: if (swap_promise_list_[i]) I'm confused by this change. Why is ...
7 years, 1 month ago (2013-11-23 10:22:06 UTC) #19
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/870001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/870001/cc/trees/layer_tree_host.cc#newcode1284 cc/trees/layer_tree_host.cc:1284: if (swap_promise_list_[i]) On 2013/11/23 10:22:07, danakj wrote: > I'm ...
7 years, 1 month ago (2013-11-23 17:21:35 UTC) #20
danakj
https://codereview.chromium.org/60513007/diff/1130001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/1130001/cc/trees/layer_tree_host.cc#newcode1284 cc/trees/layer_tree_host.cc:1284: DCHECK(swap_promise_list_[i]); Can you DCHECK this when they are added ...
7 years ago (2013-11-26 16:24:37 UTC) #21
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/1130001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/1130001/cc/trees/layer_tree_host.cc#newcode1284 cc/trees/layer_tree_host.cc:1284: DCHECK(swap_promise_list_[i]); On 2013/11/26 16:24:37, danakj wrote: > Can you ...
7 years ago (2013-11-26 17:30:34 UTC) #22
danakj
LGTM https://codereview.chromium.org/60513007/diff/1270001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/1270001/cc/trees/layer_tree_host.cc#newcode1277 cc/trees/layer_tree_host.cc:1277: DCHECK(swap_promise.get()); nit: no .get() needed https://codereview.chromium.org/60513007/diff/1270001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc ...
7 years ago (2013-11-26 17:34:19 UTC) #23
Yufeng Shen (Slow to review)
https://codereview.chromium.org/60513007/diff/1270001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/60513007/diff/1270001/cc/trees/layer_tree_host.cc#newcode1277 cc/trees/layer_tree_host.cc:1277: DCHECK(swap_promise.get()); On 2013/11/26 17:34:19, danakj wrote: > nit: no ...
7 years ago (2013-11-26 17:38:26 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miletus@chromium.org/60513007/1290001
7 years ago (2013-11-26 17:38:43 UTC) #25
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) base_unittests, browser_tests, interactive_ui_tests, net_unittests, unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=193452
7 years ago (2013-11-26 17:54:01 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miletus@chromium.org/60513007/1310001
7 years ago (2013-11-26 18:12:09 UTC) #27
commit-bot: I haz the power
7 years ago (2013-11-27 00:05:21 UTC) #28
Message was sent while issue was closed.
Change committed as 237444

Powered by Google App Engine
This is Rietveld 408576698