KhronosGroup / KhronosGroup/WebGL
Clarify OffscreenCanvas.transferToImageBitmap and preserveDrawingBuffer
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
Clarify OffscreenCanvas.transferToImageBitmap and preserveDrawingBuffer
It mandates that color buffer is cleared.
Are depth and stencil buffers preserved or cleared?
> The transferToImageBitmap() method, when invoked, must run the following steps:
> ....
> >Set this [OffscreenCanvas](https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvas) object's [bitmap](https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvas-bitmap) to reference a newly created bitmap of the same dimensions and color space as the previous bitmap, and with its pixels initialized to [transparent black>(https://drafts.csswg.org/css-color/#transparent-black), or [opaque black](https://drafts.csswg.org/css-color/#opaque-black) if the rendering context's [alpha](https://html.spec.whatwg.org/multipage/canvas.html#offscreencontext2d-alpha) flag is set to false.
>
> This means that if the rendering context of this [OffscreenCanvas](https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvas) is a [WebGLRenderingContext](https://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLRenderingContext), the value of [preserveDrawingBuffer](https://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLContextAttributes) will have no effect. [[WEBGL]](https://html.spec.whatwg.org/multipage/references.html#refsWEBGL)
Contributor guide
Assessment
This issue has not been assessed yet.