Open austinEng opened 1 year ago
How would a reftest test any of these? If I understand correctly, a ref test is a test where you make 2 HTML pages and compare screenshots. How do you compare blank pages in any useful way? What should these tests do?
Whoops. I suppose they ought to be op tests then?
Additional things that also come to mind:
canvas texture expiry still occurs
I'm not sure how I can test this. The spec seems to make it ambiguous when a texture will expire. It says
Queue a global task on the automatic expiry task source
It then goes on to say when that task executes could be
- Immediately after running any task.
- Immediately after running animation frame callbacks.
- Immediately before rendering. (which might be never for an un-rendered canvas, un-rendered because it's not visible, offscreen, not in DOM)
Or, maybe 'before rendering' means before rendering the page, not the canvas, in which case I can force a page render in various way. @kainino0x ?, @toji ?
I actually wrote a test, and just waited for timeout (which fits 1 above) and the test passed. I could change it to rAF (that would fit 1 and 2). But for 3?
As for these
AFAICT all I can do here is
Those are already done in src/webgpu/web_platform/canvas/readbackFromWebGPUCanvas.spec.ts
though that canvas is always a webgpu canvas that is not in the DOM. I can add "in dom but display: none" and "in dom but positioned offscreen" if you think that's important.
I wrote up some stuff about testing this for @shrekshao on https://bugs.chromium.org/p/chromium/issues/detail?id=1404421#c6
cc #2385
I did a little reading to remember what the heck state we left canvas texture expiry in, and I think I said the wrong thing earlier iiuc officially it's allowed for a canvas texture to not expire if the canvas isn't getting displayed
Also I reopened https://github.com/gpuweb/gpuweb/issues/3295#issuecomment-1461104644 because we need to write stuff about OffscreenCanvas in the spec.
Various ways a canvas might be hidden