feat: paint event move texture data to handle, add colorSpace#47315
feat: paint event move texture data to handle, add colorSpace#47315codebytere merged 4 commits intoelectron:mainfrom
paint event move texture data to handle, add colorSpace#47315Conversation
dcfb030 to
67cf1f4
Compare
erickzhao
left a comment
There was a problem hiding this comment.
For the breaking change, could you add an excerpt to how to migrate usage to https://github.com/electron/electron/blob/main/docs/breaking-changes.md?
|
Sure! I added a note at breaking change. @erickzhao |
67cf1f4 to
edfb89d
Compare
| texture.source_size = info->metadata.source_size; | ||
| texture.region_capture_rect = info->metadata.region_capture_rect; | ||
| texture.widget_type = view_->GetWidgetType(); | ||
| texture.is_webgpu_compatible = info->metadata.is_webgpu_compatible; |
There was a problem hiding this comment.
Are is_webgpu_compatible and supports_zero_copy_webgpu_import exposed/used anywhere? I see them being copied, but I don't see any other code that references them.
samuelmaddock
left a comment
There was a problem hiding this comment.
API LGTM
Breaking changes are fine given this API is already marked as experimental.
| * `pixelFormat` string - The pixel format of the texture. Can be `rgba` or `bgra`. | ||
| * `codedSize` [Size](size.md) - The full dimensions 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. | ||
| * `colorSpace` [ColorSpace](color-space.md) - The color space of the video frame. |
There was a problem hiding this comment.
We expose colorSpace as a string in the Display object which is a bit unfortunate. I think it's fine to expose with this struct here though. 👍
https://www.electronjs.org/docs/latest/api/structures/display
Later we can figure out whether we want to expose the struct within Display under a potentially different property name.
23137e1 to
8ccc93d
Compare
|
Fixed a UTF8 BOM issue. |
|
@samuelmaddock Hi Sam, could you rerun the flaky check or just merge this? Thanks. |
|
Release Notes Persisted
|
…lectron#47315) * feat: paint event move shared texture to handle, add color space * feat: add breaking change * fix: properties. * fix: remove utf8 bom
Description of Change
Breaking change for 'paint' event when shared texture offscreen is enabled, moved shared texture handle data to a unified
handleproperty. AddcolorSpaceinfo. Split from #46811Note that this API was marked experimental, so a breaking change should be expected by developers. Previous API put everything in root object which is not ideal.
Release Notes
Notes:
colorSpaceto offscreen shared texture info ofwebContents.on('paint')event.OffscreenSharedTextureto provide a unifiedhandlethat holds the native handle.