-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
takeScreenshotDelayed(50) is a bad heuristic for making sure rendering is done before taking the screenshot:
| takeScreenshotDelayed(50); |
See discussion: https://github.com/gpuweb/cts/pull/4479/files#r2446286603
Instead we should replace it with something that uses requestAnimationFrame, which won't fire until (just before) rendering is actually happening, then take the screenshot. Something like this (or equivalent using async) would be theoretically tightest:
function requestPostAnimationFrame(fn) {
requestAnimationFrame(() => timeout(fn, 0));
}requestPostAnimationFrame(takeScreenshot);EDIT: But see below, we need to do rAF(rAF(fn)) to be safe.
Also, might try to remove other usages of takeScreenshotDelayed so that it's private to runRefTest.
mwyrzykowski
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Open (no TODO)