Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Issue 12544032: Initialize cc::Renderer in vsync (Closed)

Created:
7 years, 9 months ago by boliu
Modified:
7 years, 7 months ago
Reviewers:
danakj, jamesr
CC:
chromium-reviews, cc-bugs_chromium.org, aelias_OOO_until_Jul13
Visibility:
Public.

Description

Merge cc initialization paths Code path between first initialization and recreate on context lost are merged. Do this by changing the first initialization behavior to match recreate. Now both are kicked off by the scheduler and blocks the main thread on the impl thread. The scheduler is started in output surface lost state and immediately schedules recreation. This means the first initialization in thread mode is no longer synchronous. BUG=233664, 230197 This has been tried many many times. NOTRY=true Reverted twice due to breaking WebGLInfobarTest: Committed in r196480. Reverted in r196509. Committed in r196708. Reverted in r196790. Fix for WebGLInfobarTest landed in r197235. WebViewTest.Shim became flaky on chromeos but was already flaky without this. Disabled it in r197497. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197550

Patch Set 1 #

Patch Set 2 : Chrome starts and renders page. Need to fix tests. #

Patch Set 3 : Work with vsync time source, test hooks #

Patch Set 4 : Some fixes, still incomplete #

Patch Set 5 : Merge create/recreate. Need thread sync version. Tests do not compile. #

Patch Set 6 : minor cleanup #

Patch Set 7 : thread_proxy sync recreate reimplemented, tests compile #

Patch Set 8 : More complicated init to fix tests crashes, no crash, 9 failing #

Patch Set 9 : One failing test left #

Patch Set 10 : Fix VerifyContext when SetOutputSurface fails. All tests passing! #

Total comments: 2

Patch Set 11 : First CreateOutputSurface async, chrome starts up and renders, broke a lot of tests again :( #

Total comments: 31

Patch Set 12 : Fix tests. More complex conditions :( #

Patch Set 13 : Cleaned up thread_proxy; have not renamed anything yet. Somewhat sane to look at now. #

Total comments: 21

Patch Set 14 : Address some of Dana's comments in thread_proxy. No var/function renames yet. #

Patch Set 15 : Add ThreadProxy::InitializationResult and fix mixing sync/async paths #

Patch Set 16 : Move more code from LHTI::SetOutputSurface to InitializeRenderer #

Patch Set 17 : Split OutputSurface::BindToClient to SetClient and BindToClient. Fix handling of renderer init fail… #

Patch Set 18 : rebase, no other change #

Patch Set 19 : reduce scope to only merge code paths #

Patch Set 20 : compiles #

Patch Set 21 : Works, needs to fix scheduler tests #

Patch Set 22 : Fix scheduler tests #

Patch Set 23 : Clean ups #

Total comments: 83

Patch Set 24 : Remove a TODO comment #

Patch Set 25 : Address some comments from Dana #

Patch Set 26 : Address more comments #

Patch Set 27 : One more rename #

Patch Set 28 : new tests #

Patch Set 29 : force init test #

Total comments: 9

Patch Set 30 : rebase #

Total comments: 37

Patch Set 31 : address moar comments #

Total comments: 16

Patch Set 32 : #

Total comments: 2

Patch Set 33 : Also cancel create callback if gave up. #

Patch Set 34 : Fix tests calling sync init #

Patch Set 35 : Fail LTH create if cannot create OS #

Patch Set 36 : And check impl output surface start before declaring lost. #

Patch Set 37 : Don't set proxy unless created output surface #

Patch Set 38 : Fix more DCHECK conditions. Should add a test for this. #

Patch Set 39 : More DCHECK fixes #

Patch Set 40 : rebase #

Total comments: 5

Patch Set 41 : new tests #

Total comments: 1

Patch Set 42 : #

Total comments: 1

Patch Set 43 : typo #

Patch Set 44 : rebase #

Patch Set 45 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+729 lines, -480 lines) Patch
M cc/layers/nine_patch_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/scrollbar_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 2 chunks +1 line, -3 lines 0 comments Download
M cc/layers/tiled_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 chunk +1 line, -1 line 0 comments Download
M cc/scheduler/scheduler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 34 35 3 chunks +6 lines, -3 lines 0 comments Download
M cc/scheduler/scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3 chunks +7 lines, -7 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 34 35 5 chunks +8 lines, -6 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 34 35 7 chunks +25 lines, -13 lines 0 comments Download
M cc/scheduler/scheduler_state_machine_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 39 chunks +136 lines, -36 lines 0 comments Download
M cc/scheduler/scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 14 chunks +43 lines, -15 lines 0 comments Download
M cc/test/fake_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +7 lines, -5 lines 0 comments Download
M cc/test/fake_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +8 lines, -5 lines 0 comments Download
M cc/test/layer_tree_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +1 line, -1 line 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 4 chunks +9 lines, -9 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 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 6 chunks +68 lines, -76 lines 0 comments Download
M cc/trees/layer_tree_host_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 2 chunks +2 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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 11 chunks +13 lines, -18 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 21 chunks +181 lines, -44 lines 0 comments Download
M cc/trees/proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 3 chunks +7 lines, -13 lines 0 comments Download
M cc/trees/single_thread_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 4 chunks +6 lines, -9 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 10 chunks +48 lines, -52 lines 0 comments Download
M cc/trees/thread_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 8 chunks +20 lines, -24 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 14 chunks +129 lines, -136 lines 0 comments Download

Messages

Total messages: 52 (0 generated)
boliu
Hey James, This is the initial still incomplete patch to move cc::Renderer::Initialize inside onTimerTick so ...
7 years, 9 months ago (2013-03-25 23:12:02 UTC) #1
jamesr
Holding the main thread blocked until the first vsync is going to be too slow, ...
7 years, 9 months ago (2013-03-25 23:16:46 UTC) #2
boliu
James, could you point me some perf tests that would affected by changing code here? ...
7 years, 9 months ago (2013-03-27 19:36:28 UTC) #3
boliu
Hey James, could you take a look at the description of this CL and see ...
7 years, 8 months ago (2013-03-30 01:46:20 UTC) #4
boliu
On 2013/03/30 01:46:20, boliu wrote: > Hey James, could you take a look at the ...
7 years, 8 months ago (2013-04-01 23:43:04 UTC) #5
jamesr
Is there something specific you want me to look at? This looks incomplete, but I ...
7 years, 8 months ago (2013-04-02 22:42:08 UTC) #6
boliu
On 2013/04/02 22:42:08, jamesr wrote: > Is there something specific you want me to look ...
7 years, 8 months ago (2013-04-02 23:57:15 UTC) #7
jamesr
On 2013/04/02 23:57:15, boliu wrote: > On 2013/04/02 22:42:08, jamesr wrote: > > Is there ...
7 years, 8 months ago (2013-04-03 00:17:01 UTC) #8
boliu
Question about retrying recreate logic. What is it trying to accomplish? The retry logic only ...
7 years, 8 months ago (2013-04-03 19:20:49 UTC) #9
boliu
Hey James, could you take a look at layer_tree_host, single_thread_proxy, and thread_proxy. I tried to ...
7 years, 8 months ago (2013-04-04 00:16:36 UTC) #10
boliu_use_chromium_pls
Status update: Implementation probably correct since last few failing tests were due to some assumptions ...
7 years, 8 months ago (2013-04-09 02:10:59 UTC) #11
jamesr
I'm not sure I understand why the logic for initially creating the renderer is different ...
7 years, 8 months ago (2013-04-09 21:26:19 UTC) #12
boliu
On 2013/04/09 21:26:19, jamesr wrote: > I'm not sure I understand why the logic for ...
7 years, 8 months ago (2013-04-09 21:53:07 UTC) #13
jamesr
On 2013/04/09 21:53:07, boliu wrote: > On 2013/04/09 21:26:19, jamesr wrote: > > I'm not ...
7 years, 8 months ago (2013-04-09 21:54:59 UTC) #14
boliu
On 2013/04/09 21:54:59, jamesr wrote: > On 2013/04/09 21:53:07, boliu wrote: > > The difference ...
7 years, 8 months ago (2013-04-09 22:08:48 UTC) #15
jamesr
On 2013/04/09 22:08:48, boliu wrote: > On 2013/04/09 21:54:59, jamesr wrote: > > On 2013/04/09 ...
7 years, 8 months ago (2013-04-09 22:29:50 UTC) #16
boliu
On 2013/04/09 22:29:50, jamesr wrote: > Yes - I think those are incorrect. Any settings ...
7 years, 8 months ago (2013-04-09 22:47:18 UTC) #17
jamesr
On 2013/04/09 22:47:18, boliu wrote: > On 2013/04/09 22:29:50, jamesr wrote: > > Yes - ...
7 years, 8 months ago (2013-04-09 22:54:31 UTC) #18
danakj
Is there any way to stage this change into a few smaller patches? If it's ...
7 years, 8 months ago (2013-04-10 16:40:14 UTC) #19
boliu
On 2013/04/10 16:40:14, danakj wrote: > Is there any way to stage this change into ...
7 years, 8 months ago (2013-04-10 17:36:35 UTC) #20
danakj
https://codereview.chromium.org/12544032/diff/43001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/12544032/diff/43001/cc/trees/layer_tree_host.cc#newcode170 cc/trees/layer_tree_host.cc:170: client_->WillRetryRecreateOutputSurface(); On 2013/04/10 17:36:36, boliu wrote: > On 2013/04/10 ...
7 years, 8 months ago (2013-04-10 17:51:00 UTC) #21
boliu
Cleaned up thread_proxy, merging/simplifying functions etc. Have not renamed anything though. But it's finally somewhat ...
7 years, 8 months ago (2013-04-11 19:29:26 UTC) #22
danakj
https://codereview.chromium.org/12544032/diff/64001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/12544032/diff/64001/cc/trees/thread_proxy.cc#newcode994 cc/trees/thread_proxy.cc:994: if (was_first_create && has_renderer_capabilities_on_impl_thread_) accessing an impl variable on ...
7 years, 8 months ago (2013-04-12 00:38:35 UTC) #23
danakj
There's a lot of naming stuff to clean up and the code feels a bit ...
7 years, 8 months ago (2013-04-12 00:39:31 UTC) #24
boliu
Addressed some comments but still horrible names everywhere. Ran through the default set of trybots ...
7 years, 8 months ago (2013-04-12 02:10:20 UTC) #25
boliu
Ready for a closer look for merging code paths.
7 years, 8 months ago (2013-04-22 16:00:13 UTC) #26
danakj
Hey, this is pretty cool! I left a whole bunch of comments for you. I ...
7 years, 8 months ago (2013-04-22 18:03:41 UTC) #27
boliu
Addressed all somments except no new tests yet. Going to first check if this broke ...
7 years, 8 months ago (2013-04-22 23:32:05 UTC) #28
boliu
On 2013/04/22 18:03:41, danakj wrote: > Can you add some tests for the new code ...
7 years, 8 months ago (2013-04-23 01:46:35 UTC) #29
danakj
Looking good, LTH is a lot cleaner now. I think there's a bit we can ...
7 years, 8 months ago (2013-04-23 18:22:39 UTC) #30
danakj
https://codereview.chromium.org/12544032/diff/133002/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/12544032/diff/133002/cc/trees/thread_proxy.cc#newcode255 cc/trees/thread_proxy.cc:255: DCHECK(had_output_surface_initialized_); On 2013/04/23 18:22:40, danakj wrote: > i'd like ...
7 years, 8 months ago (2013-04-23 18:34:00 UTC) #31
boliu
If I didn't have a reply, interpret as "Done". Now the reply is actually short ...
7 years, 8 months ago (2013-04-24 01:28:52 UTC) #32
danakj
I love it :) There's one if() in thread proxy which I think is always ...
7 years, 8 months ago (2013-04-24 15:38:42 UTC) #33
boliu
https://codereview.chromium.org/12544032/diff/151001/cc/trees/layer_tree_host_unittest_context.cc File cc/trees/layer_tree_host_unittest_context.cc (right): https://codereview.chromium.org/12544032/diff/151001/cc/trees/layer_tree_host_unittest_context.cc#newcode1202 cc/trees/layer_tree_host_unittest_context.cc:1202: layer_tree_host()->CompositeAndReadback(bitmap.getPixels(), rect); On 2013/04/24 15:38:42, danakj wrote: > char ...
7 years, 8 months ago (2013-04-24 17:48:19 UTC) #34
danakj
https://codereview.chromium.org/12544032/diff/158001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/12544032/diff/158001/cc/trees/thread_proxy.cc#newcode247 cc/trees/thread_proxy.cc:247: output_surface_creation_callback_.Cancel(); Should we Cancel() if CreateFailedAndGiveUp too? I'm thinking ...
7 years, 8 months ago (2013-04-24 20:43:01 UTC) #35
danakj
https://codereview.chromium.org/12544032/diff/151001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/12544032/diff/151001/cc/trees/thread_proxy.cc#newcode1109 cc/trees/thread_proxy.cc:1109: if (scheduler_on_impl_thread_->HasInitializedOutputSurface()) { On 2013/04/24 17:48:20, boliu wrote: > ...
7 years, 8 months ago (2013-04-24 21:01:00 UTC) #36
boliu
Question: Now we retry 5 times before stopping. What if the error is in CreateOutputSurface ...
7 years, 8 months ago (2013-04-24 22:01:00 UTC) #37
danakj
On 2013/04/24 22:01:00, boliu wrote: > Question: Now we retry 5 times before stopping. What ...
7 years, 8 months ago (2013-04-24 23:17:13 UTC) #38
boliu
On 2013/04/24 23:17:13, danakj wrote: > 1) The context creation fails. We should not retry ...
7 years, 8 months ago (2013-04-25 01:03:35 UTC) #39
danakj
This patch LGTM. One request for a one last test to watch for the race ...
7 years, 8 months ago (2013-04-25 15:16:48 UTC) #40
boliu
Two new tests: LayerTreeHostContextTestCompositeAndReadbackBeforeOutputSurfaceInit to explicitly test CompositeAndReadback initializes OutputSurface before the scheduler's posted task ...
7 years, 8 months ago (2013-04-25 17:25:11 UTC) #41
danakj
Thanks :) New tests LGTM, I'm glad you did the 2nd one outside of the ...
7 years, 8 months ago (2013-04-25 17:36:46 UTC) #42
jamesr
lgtm2! Thank you for persisting with this and thank you Dana for all the reviews. ...
7 years, 8 months ago (2013-04-25 18:04:53 UTC) #43
boliu
And thanks for all the guidance and timely reviews.
7 years, 8 months ago (2013-04-25 18:11:29 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/12544032/142002
7 years, 8 months ago (2013-04-25 18:11:49 UTC) #45
commit-bot: I haz the power
Change committed as 196480
7 years, 8 months ago (2013-04-25 20:29:10 UTC) #46
boliu
Reopening in preparation for reland. Added this to the description: First commited in r196480. Reverted ...
7 years, 8 months ago (2013-04-25 23:23:43 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/12544032/213002
7 years, 8 months ago (2013-04-26 10:09:14 UTC) #48
commit-bot: I haz the power
Change committed as 196708
7 years, 8 months ago (2013-04-26 12:34:57 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/12544032/213002
7 years, 7 months ago (2013-04-30 23:14:48 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/12544032/237001
7 years, 7 months ago (2013-05-01 00:31:58 UTC) #51
commit-bot: I haz the power
7 years, 7 months ago (2013-05-01 03:13:25 UTC) #52
Message was sent while issue was closed.
Change committed as 197550

Powered by Google App Engine
This is Rietveld 408576698