-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat: paint
event move texture data to handle
, add colorSpace
#47315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dcfb030
to
67cf1f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.timestamp = info->timestamp.InMicroseconds(); | ||
texture.frame_count = info->metadata.capture_counter.value_or(0); | ||
texture.capture_update_rect = info->metadata.capture_update_rect; | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Breaking changes are fine given this API is already marked as experimental.
@@ -4,21 +4,15 @@ | |||
* `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`. | |||
* `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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Description of Change
Breaking change for 'paint' event when shared texture offscreen is enabled, moved shared texture handle data to a unified
handle
property. AddcolorSpace
info. 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:
colorSpace
to offscreen shared texture info ofwebContents.on('paint')
event.OffscreenSharedTexture
to provide a unifiedhandle
that holds the native handle.