Bug 1677929 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Looking at the control flow in [`APZCTreeManager::SampleForWebRender`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/APZCTreeManager.cpp#711), I'm not sure how the frame delay is supposed to work:

 - We call `AdvanceAnimationsInternal` before we call `apzc->NotifyScrollSampling()`.
 - During `AdvanceAnimationsInternal`, via `AdvanceAnimations` and `UpdateAnimation`, [we call `SampleCompositedAsyncTransform`](https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/AsyncPanZoomController.cpp#4186), [which moves the current payloads from `mScrollPayload` to `mSampledState`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/AsyncPanZoomController.cpp#4410).
 - Then we reach [the call to `apzc->NotifyScrollSampling()`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/APZCTreeManager.cpp#744), which [returns the payload that we just put into `mSampledState`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/AsyncPanZoomController.cpp#3202).
 - Then we enqueue the payload associated with the current (pipeline, epoch) pair.
 - When rendering is done, we look up the payload based on the rendered (pipeline, epoch) pairs.

Based on this reading I'm surprised that some of the payloads are correctly delayed.
Edit: this comment was confused, please ignore.

Looking at the control flow in [`APZCTreeManager::SampleForWebRender`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/APZCTreeManager.cpp#711), I'm not sure how the frame delay is supposed to work:

 - We call `AdvanceAnimationsInternal` before we call `apzc->NotifyScrollSampling()`.
 - During `AdvanceAnimationsInternal`, via `AdvanceAnimations` and `UpdateAnimation`, [we call `SampleCompositedAsyncTransform`](https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/AsyncPanZoomController.cpp#4186), [which ~~moves~~ enqueues the current payloads from `mScrollPayload` to `mSampledState`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/AsyncPanZoomController.cpp#4410).
 - Then we reach [the call to `apzc->NotifyScrollSampling()`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/APZCTreeManager.cpp#744), which [~~returns the payload that we just put into~~ pops the oldest enqueued payload from `mSampledState`](https://searchfox.org/mozilla-central/rev/7b40f0b246ad0b54975b1525811f2ad599b95f33/gfx/layers/apz/src/AsyncPanZoomController.cpp#3202).
 - Then we enqueue the payload associated with the current (pipeline, epoch) pair.
 - When rendering is done, we look up the payload based on the rendered (pipeline, epoch) pairs.

~~Based on this reading I'm surprised that some of the payloads are correctly delayed.~~

Back to Bug 1677929 Comment 1