You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
app,gpu,op: [android,ios,macos,windows] add ExternalOp paint for external views
This change adds paint.ExternalOp, which allows native views, activities, or HWNDs to appear inside a Gio layout.
The implementation uses a punch-through method. Gio marks a region as transparent so the layer below becomes visible. The external view receives that region and renders there.
Before this change, integrating external components such as WebView, Ads, or Camera views had two problems.
1. Gio content could not render above the external view.
2. The external view required an absolute position. That was difficult when combined with offsets or transformations.
The paint.ExternalOp reduces both issues while keeping the API simple. The operation includes a callback that runs every frame. The callback can update position, size, and z-order to keep the native view synchronized with the Gio layout.
Platform behavior required small adjustments, mainly on Windows.
Windows uses an extra child window:
MainWindow → GioWindow
This structure allows additional HWNDs to attach to the MainWindow while GioWindow remains on top. For example:
MainWindow → GioWindow → WebView
ExternalOp exposes a region of the GioWindow so the underlying HWND, such as a WebView, becomes visible in that area.
On macOS, iOS, and Android the rendering stack already uses additional layers. No structural change was required there, only the background was changed to Transparent.
Implements: https://todo.sr.ht/~eliasnaur/gio/428
Signed-off-by: inkeliz <inkeliz@inkeliz.com>
0 commit comments