diff options
| author | Adam Malczewski <[email protected]> | 2026-06-13 21:00:07 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-13 21:00:07 +0900 |
| commit | be5f67f7c7cf2710b0e73df5d92be98c758c47a4 (patch) | |
| tree | 857e0e9df72675d223b2a2f643c4d49ff01a5b50 /packages/kernel/src/server.cpp | |
| parent | 4f5779cec17b0e9173d2b1de634c31c516069670 (diff) | |
| download | unbox-be5f67f7c7cf2710b0e73df5d92be98c758c47a4.tar.gz unbox-be5f67f7c7cf2710b0e73df5d92be98c758c47a4.zip | |
kernel: ui surfaces composite with per-pixel alpha + set_size resizes the target
Two substrate capabilities the stage dock forced (both verified real-seat nested
and on the gles2 headless path):
1. Per-pixel alpha. A ui surface composited opaque, so any overlay (the dock)
occluded the toplevels beneath it. Root cause: a stray opaque
render_iface->Clear() (glClearColor 0,0,0,1) in render_surface overrode the
transparent BeginFrame clear, and EndFrame's premultiplied composite carried
the opaque base to the buffer. Fix: drop the stray Clear(); clear the OUTPUT
FBO to (0,0,0,0) once before BeginFrame. Blend was already correct
premultiplied; the substrate never sets an opaque region (now guarded by a
probe); ARGB8888 alpha survives end to end. A document whose <body> is
transparent now shows the scene through its un-painted pixels.
2. set_size resizes the render target. Previously logical-only (the slice-5
documented change-request): set_size re-laid-out the RmlUi document but did
NOT realloc the GL target, so a surface created small and grown rendered into
its original buffer (the dock, created as a 1px placeholder and grown on
minimize, was invisible). Fix: set_size now reallocs the FBO + dmabuf
swapchain/shm + EGLImage + texture + scene buffer on an ACTUAL size change
(no-op same-size, cheap; set_position still cheap). Grow and shrink both
render fully; alpha/upright-flip/blend/fence-sync preserved.
ui.hpp documents both. kernel 45 cases/182 assertions green on build + build-asan
(no new suppressions). Edits confined to packages/kernel/.
Diffstat (limited to 'packages/kernel/src/server.cpp')
| -rw-r--r-- | packages/kernel/src/server.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/kernel/src/server.cpp b/packages/kernel/src/server.cpp index 95631df..d97104e 100644 --- a/packages/kernel/src/server.cpp +++ b/packages/kernel/src/server.cpp @@ -89,6 +89,14 @@ auto Server::ui_pixel(int x, int y) const -> unsigned int { return impl_->substrate != nullptr ? impl_->substrate->surface_pixel(x, y) : 0U; } +auto Server::ui_surface_has_opaque_region() const -> bool { + return impl_->substrate != nullptr && impl_->substrate->surface_has_opaque_region(); +} + +auto Server::ui_resize_realloc_count() const -> int { + return impl_->substrate != nullptr ? impl_->substrate->resize_realloc_count() : 0; +} + auto Server::ui_element_count(const char* tag) const -> int { return impl_->substrate != nullptr ? impl_->substrate->element_count(tag) : 0; } |
