Descriptioncc: Don't double-tick unthrottled FrameRateController
When the FrameRateController is configured with a non-throttling time
source (i.e., vsync is off), it posts the next tick task manually
whenever it is active at the end of a previous tick. However, it also
posts a manual tick task when a swap buffers call completes to make sure
rendering doesn't stall.
These two tick task sources combined can lead to an expential growth of
tick tasks. Consider the following call tree where each edge is an
asynchronous task:
OnTimerTick
| |
| `--------------------.
| |
BeginImplFrame |
Deadline |
| |
OnSwapBuffers |
Complete |
| |
OnTimerTick OnTimerTick
| | | |
| `--------. | `----------.
| | | |
BeginImplFrame | BeginImplFrame |
Deadline | Deadline |
| | | |
OnSwapBuffers | OnSwapBuffers |
Complete | Complete |
| | | |
OnTimerTick OnTimerTick OnTimerTick OnTimerTick
| | | | | | | |
: : : : : : : :
(etc.)
In practice this situation happens if both the impl and main threads request a
BeginFrame and when the tick task runs, the scheduler isn't ready to draw
because the previous BeginFrame deadline hasn't triggered yet. This means the
the pending swap count never increases to the throttling limit and each timer
tick causes another one to get queued. Once the deadline triggers and we do
swap, the swap completion spawns a parallel line of tick tasks.
This patch fixes the problem by only queueing a new tick task if we haven't
queued one already.
BUG=312960
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235178
Patch Set 1 #
Total comments: 1
Patch Set 2 : Pull out change to disable deadline scheduling. #
Messages
Total messages: 8 (0 generated)
|