(In reply to Botond Ballo [:botond] from comment #14) > That said, I'm a bit curious what makes this approach necessary. I think the original idea behind the frame delay was that if the main thread consistently paints things within the frame budget, then the display lists and corresponding samples (that would have the same generation with this approach) would just naturally align. I'm curious why this doesn't happen -- does a mis-alignment get introduced because sometimes one of the steps involved takes **longer** than one frame? Or sometimes a step happens **twice** in one frame? No, what happens is that an opposed case. A round trip scroll offset (initiated by an APZC and reported to the main-thread, and the offset has been received in the [WebRender's scroll offset](https://searchfox.org/mozilla-central/rev/ac7a567f036e1954542763f4722fbfce041fb752/gfx/wr/webrender/src/spatial_node.rs#839), happens within a Vsync tick. (Vsync tick isn't precisely describing the situation because there are a couple of different threads running). For example, an APZC has two sampled offsets, say 10px and 20px, and the APZC notify the 20px in a RepaintRequest to the main-thread, then the main-thread gets the 20px and update the scroll position in question and an abs-pos element uses 20px, then an display item having 20px is notified to the WebRender, then WebRenders renders that the scroller's position 10px, but the abs-pos position is 20px.
Bug 1571758 Comment 16 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Botond Ballo [:botond] from comment #14) > That said, I'm a bit curious what makes this approach necessary. I think the original idea behind the frame delay was that if the main thread consistently paints things within the frame budget, then the display lists and corresponding samples (that would have the same generation with this approach) would just naturally align. I'm curious why this doesn't happen -- does a mis-alignment get introduced because sometimes one of the steps involved takes **longer** than one frame? Or sometimes a step happens **twice** in one frame? No, what happens is that an opposed case. A round trip scroll offset (initiated by an APZC and reported to the main-thread, and the offset has been received in the [WebRender's scroll offset](https://searchfox.org/mozilla-central/rev/ac7a567f036e1954542763f4722fbfce041fb752/gfx/wr/webrender/src/spatial_node.rs#839)), happens within a Vsync tick. (Vsync tick isn't precisely describing the situation because there are a couple of different threads running). For example, an APZC has two sampled offsets, say 10px and 20px, and the APZC notify the 20px in a RepaintRequest to the main-thread, then the main-thread gets the 20px and update the scroll position in question and an abs-pos element uses 20px, then an display item having 20px is notified to the WebRender, then WebRender renders that the scroller's position 10px, but the abs-pos position is 20px.