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

Issue 23503003: cc: Add readback and forced draw states to the Scheduler (Closed)

Created:
7 years, 3 months ago by brianderson
Modified:
7 years, 2 months ago
Reviewers:
danakj, nduca, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, piman, jdduke (slow), joth, boliu, Sami (do not use)
Base URL:
http://git.chromium.org/chromium/src.git@schedReorg3
Visibility:
Public.

Description

cc: Add readback and forced draw states to the Scheduler. Readback doesn't have all its steps synchronized properly with impl side painting enabled. This patch prevents the readback commit from being swapped to screen and avoids using non-readback commits for readback by adding a SynchronousReadbackState. This patch also gives forced draws due to checkerboarding its own ForcedReadback state that behaves independently of readback. Previously readback and forced draws shared drawing mechanisms, but we want readbacks to occur ASAP while we want forced draws to occur inline with the normal frame scheduling. BUG=276082 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=221854

Patch Set 1 #

Patch Set 2 : Normal functionality working. More test fixes pending. #

Total comments: 3

Patch Set 3 : Fix all non-scheduler unit tests #

Patch Set 4 : rename needs_draw_and_swap_ back to needs_redraw_ #

Total comments: 1

Patch Set 5 : Fix all the tests #

Total comments: 36

Patch Set 6 : address comments #

Patch Set 7 : replace active_tree_has_been_drawn with active_tree_needs_first_draw; tests pending #

Patch Set 8 : Add a readback during forced draw test #

Total comments: 4

Patch Set 9 : fix test #

Patch Set 10 : tests complete #

Patch Set 11 : rebase #

Total comments: 6

Patch Set 12 : Fix mac_rel failure by returning false from CanReadback when context lost #

Total comments: 2

Patch Set 13 : Don't abuse CanReadback #

Total comments: 1

Patch Set 14 : Address enne's commetns #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+971 lines, -466 lines) Patch
M cc/scheduler/scheduler.h View 1 2 3 4 5 3 chunks +12 lines, -17 lines 0 comments Download
M cc/scheduler/scheduler.cc View 1 2 3 4 5 6 7 6 chunks +15 lines, -12 lines 0 comments Download
M cc/scheduler/scheduler_settings.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M cc/scheduler/scheduler_settings.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.h View 1 2 3 4 5 6 7 11 chunks +36 lines, -22 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 28 chunks +283 lines, -135 lines 1 comment Download
M cc/scheduler/scheduler_state_machine_unittest.cc View 1 2 3 4 5 6 7 37 chunks +181 lines, -196 lines 0 comments Download
M cc/scheduler/scheduler_unittest.cc View 1 2 3 4 5 5 chunks +63 lines, -22 lines 0 comments Download
M cc/test/layer_tree_test.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 7 2 chunks +15 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +98 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +181 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_settings.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_settings.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -3 lines 0 comments Download
M cc/trees/thread_proxy.h View 1 2 3 4 5 3 chunks +9 lines, -6 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +72 lines, -53 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
brianderson
I haven't looked at tests yet and this doesn't quite right for me yet, but ...
7 years, 3 months ago (2013-08-27 05:01:55 UTC) #1
brianderson
PTAL. Test changes still in progress, but this patch should otherwise be close to its ...
7 years, 3 months ago (2013-08-27 22:27:29 UTC) #2
brianderson
All tests, other than the Scheduler unit tests themselves, are passing now. https://codereview.chromium.org/23503003/diff/3001/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc ...
7 years, 3 months ago (2013-08-28 02:52:08 UTC) #3
brianderson
All tests have been fixed now. PTAL.
7 years, 3 months ago (2013-08-28 03:54:34 UTC) #4
brianderson
https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler_state_machine_unittest.cc File cc/scheduler/scheduler_state_machine_unittest.cc (left): https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler_state_machine_unittest.cc#oldcode111 cc/scheduler/scheduler_state_machine_unittest.cc:111: TEST(SchedulerStateMachineTest, TestSetForcedRedrawDoesNotSetsNormalRedraw) { I removed this test because ToT ...
7 years, 3 months ago (2013-08-29 19:23:09 UTC) #5
danakj
On Thu, Aug 29, 2013 at 3:23 PM, <brianderson@chromium.org> wrote: > Fixing the test and ...
7 years, 3 months ago (2013-08-29 19:46:46 UTC) #6
danakj
https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler.cc File cc/scheduler/scheduler.cc (right): https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler.cc#newcode232 cc/scheduler/scheduler.cc:232: client_->ScheduledActionDrawAndReadback(); How about a DrawAndReadback() method above that can ...
7 years, 3 months ago (2013-08-30 15:56:41 UTC) #7
brianderson
https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler.cc File cc/scheduler/scheduler.cc (right): https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler.cc#newcode232 cc/scheduler/scheduler.cc:232: client_->ScheduledActionDrawAndReadback(); On 2013/08/30 15:56:41, danakj wrote: > How about ...
7 years, 3 months ago (2013-09-03 22:41:11 UTC) #8
danakj
https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc (right): https://codereview.chromium.org/23503003/diff/18001/cc/scheduler/scheduler_state_machine.cc#newcode571 cc/scheduler/scheduler_state_machine.cc:571: if (readback_state_ == READBACK_STATE_IDLE) { On 2013/09/03 22:41:12, Brian ...
7 years, 3 months ago (2013-09-03 22:45:01 UTC) #9
brianderson
I am working on new tests now. Any more feedback on the latest patch?
7 years, 3 months ago (2013-09-04 19:31:03 UTC) #10
brianderson
Working on more tests, but wanted feedback from folks familiar with the delegated renderer regarding ...
7 years, 3 months ago (2013-09-04 21:34:38 UTC) #11
brianderson
https://codereview.chromium.org/23503003/diff/43001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/23503003/diff/43001/cc/trees/layer_tree_host_unittest.cc#newcode547 cc/trees/layer_tree_host_unittest.cc:547: EXPECT_EQ(prepare_to_draw_count_, 3); On 2013/09/04 21:34:39, Brian Anderson wrote: > ...
7 years, 3 months ago (2013-09-04 21:48:59 UTC) #12
enne (OOO)
I am really not sure I follow what the need for a "replacement commit" after ...
7 years, 3 months ago (2013-09-04 23:24:32 UTC) #13
brianderson
Using the async readback path would be nice, since it would greatly simplify the scheduler. ...
7 years, 3 months ago (2013-09-05 00:04:51 UTC) #14
danakj
On Wed, Sep 4, 2013 at 7:24 PM, <enne@chromium.org> wrote: > I am really not ...
7 years, 3 months ago (2013-09-05 20:07:28 UTC) #15
danakj
On Wed, Sep 4, 2013 at 8:04 PM, <brianderson@chromium.org> wrote: > Using the async readback ...
7 years, 3 months ago (2013-09-05 20:09:20 UTC) #16
brianderson
After some thought, I would like to land this patch as-is to make C&R correct ...
7 years, 3 months ago (2013-09-05 23:17:07 UTC) #17
enne (OOO)
Thanks for all the investigation and research. It's helpful to know what the actual source ...
7 years, 3 months ago (2013-09-06 15:40:13 UTC) #18
brianderson
https://codereview.chromium.org/23503003/diff/62001/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://codereview.chromium.org/23503003/diff/62001/cc/output/direct_renderer.cc#newcode139 cc/output/direct_renderer.cc:139: return !output_surface_->IsLost(); This hopefully fixes the mac_rel failure when ...
7 years, 3 months ago (2013-09-06 21:43:15 UTC) #19
danakj
https://codereview.chromium.org/23503003/diff/62001/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://codereview.chromium.org/23503003/diff/62001/cc/output/direct_renderer.cc#newcode139 cc/output/direct_renderer.cc:139: return !output_surface_->IsLost(); On 2013/09/06 21:43:15, Brian Anderson wrote: > ...
7 years, 3 months ago (2013-09-06 21:45:56 UTC) #20
brianderson
https://codereview.chromium.org/23503003/diff/83001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/23503003/diff/83001/cc/trees/thread_proxy.cc#newcode1078 cc/trees/thread_proxy.cc:1078: if (draw_frame && !layer_tree_host_impl_->IsContextLost()) { It was easier to ...
7 years, 3 months ago (2013-09-06 22:04:28 UTC) #21
enne (OOO)
After staring at this a bunch, this lgtm. I do think this adds a whole ...
7 years, 3 months ago (2013-09-06 22:24:29 UTC) #22
brianderson
The patch that abuses CanReadback fixed the test that I added that loses the context ...
7 years, 3 months ago (2013-09-06 22:45:00 UTC) #23
brianderson
Not sure what happened, but it looks like the more straight-forward way of detecting a ...
7 years, 3 months ago (2013-09-06 23:40:48 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/brianderson@chromium.org/23503003/96001
7 years, 3 months ago (2013-09-06 23:41:58 UTC) #25
commit-bot: I haz the power
Change committed as 221854
7 years, 3 months ago (2013-09-07 01:47:31 UTC) #26
brianderson
7 years, 2 months ago (2013-10-04 17:17:43 UTC) #27
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/23503003/diff/96001/cc/scheduler/sched...
File cc/scheduler/scheduler_state_machine.cc (left):

https://chromiumcodereview.appspot.com/23503003/diff/96001/cc/scheduler/sched...
cc/scheduler/scheduler_state_machine.cc:553: commit_state_ = COMMIT_STATE_IDLE;
If the active tree was drawn twice (because of an animation or otherwise) ToT
prior to this patch would start the next commit before activation because it
would transition straight to idle here.  ToT doesn't (and didn't) have the logic
to enforce proper back pressure if a commit was started while there was still a
pending tree.

Scary. It seems to me that the pending tree could have just been overwritten
when the next commit came in?  This was also artificially inflating our perf
benchmarks. See https://code.google.com/p/chromium/issues/detail?id=287756 for
background.

It's also a good indication though that we should try to get
https://codereview.chromium.org/23907006 in, which does implement the proper
back pressure and starts the next commit without needing an additional draw to
kick it off.

Powered by Google App Engine
This is Rietveld 408576698