feat: offscreen rendering support rgbaf16 hdr output format. (#48265)

* feat: offscreen rendering support rgbaf16

* docs: update doc

* docs: update doc.
This commit is contained in:
reito
2025-10-09 16:33:34 +08:00
committed by GitHub
parent 9c38917a14
commit 9e46efb8f7
11 changed files with 73 additions and 16 deletions

View File

@@ -2,7 +2,10 @@
* `textureInfo` Object - The shared texture info.
* `widgetType` string - The widget type of the texture. Can be `popup` or `frame`.
* `pixelFormat` string - The pixel format of the texture. Can be `rgba` or `bgra`.
* `pixelFormat` string - The pixel format of the texture.
* `rgba` - The texture format is 8-bit unorm RGBA.
* `bgra` - The texture format is 8-bit unorm BGRA.
* `rgbaf16` - The texture format is 16-bit float RGBA.
* `codedSize` [Size](size.md) - The full dimensions of the video frame.
* `colorSpace` [ColorSpace](color-space.md) - The color space of the video frame.
* `visibleRect` [Rectangle](rectangle.md) - A subsection of [0, 0, codedSize.width, codedSize.height]. In OSR case, it is expected to have the full section area.

View File

@@ -87,6 +87,11 @@
paint event. Defaults to `false`. See the
[offscreen rendering tutorial](../../tutorial/offscreen-rendering.md) for
more details.
* `sharedTexturePixelFormat` string (optional) _Experimental_ - The requested output format of the shared texture. Defaults to `argb`.
The name is originated from Chromium [`media::VideoPixelFormat`](https://source.chromium.org/chromium/chromium/src/+/main:media/base/video_types.h) enum suffix and only subset of them are supported.
The actual output pixel format and color space of the texture should refer to [`OffscreenSharedTexture`](../structures/offscreen-shared-texture.md) object in the `paint` event.
* `argb` - The requested output texture format is 8-bit unorm RGBA, with SRGB SDR color space.
* `rgbaf16` - The requested output texture format is 16-bit float RGBA, with scRGB HDR color space.
* `contextIsolation` boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `true`. The context that the `preload` script runs in will only have