Closed Bug 1457470 Opened 3 years ago Closed 3 years ago

Avoid race condition where we sample APZ transforms concurrently with updating the hit-testing tree


(Core :: Graphics: WebRender, enhancement, P1)

Other Branch





(Reporter: kats, Assigned: kats)


(Blocks 2 open bugs)


(Whiteboard: [gfx-noted])

With the patch from bug 1457466 I discovered a small race condition that makes the scrollbar jittery while scrolling around on

The problem is at [1] we run the post-swap hook concurrently with the sampler hook at [2], and this can produce unexpected results. Consider the scenario where we have an inflight scene build happening on the scene builder thread, and the built scene is sent over to the render backend thread. The RB thread also gets a GenerateFrame transaction in its queue following the built scene transaction. The scene swap happens on the RB thread, and then the RB thread continues processing its queue and does the sampling for the GenerateFrame transaction. Meanwhile, the scene builder thread got unblocked and is running the post-swap hook. If the sampling happens before the post-swap hook is done, the sampled values will be relative to the old scene, because it's the post-swap hook that updates the APZ's last-content-paint information. We need to ensure that the GenerateFrame doesn't sample until after the post-swap hook is done and APZ has the new scene information installed.

Fixed via github PR which got merged into gecko.
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.