fserb / canvas2D

Update Canvas 2D API
Other
149 stars 25 forks source link

Further revision to WebGPU transfer spec. #43

Closed johnstiles-google closed 4 months ago

johnstiles-google commented 4 months ago

I did some scrolling through existing API and came to the conclusion that "WebGPU" is just a marketing name, but not an API name. The actual WebGPU APIs never contain the word "Web" anywhere. And really, that makes sense; it's redundant to explicitly label something as "Web" in a WebIDL spec.

This revision strips out "Web" from our API names.

transfer(To|From)GPU at that point did not seem to be sufficiently descriptive, so they are now transfer(To|From)GPUTexture.

I would also like to pitch CanvasTransferableGPUTexture as the name of the GPUTexture subclass. I mulled it over last night and I think it is better than Canvas2dGPUTexture and more usefully descriptive than CanvasBackedGPUTexture. (The user is less interested in the backing store, and more interested in how the object can be used.) And since users don't need to type it, the length is a non-issue.

I can make these changes relatively quickly to the source if we agree on them in principle.