Repository navigation
feat(scene): browser source popups draw over the page and take input - #36
Conversation
Quest-Claim: 960434867f3e1bc0
CEF paints a popup widget, such as a <select>'s list, apart from the page. The helper now forwards those paints and the popup's area, and the studio keeps each page's view clean and copies the popup over a copy of it, on both the shared-texture and the upload paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A popup's first paints can be transparent, which a copy turned into a hole through the page to the scene behind it. Draw it premultiplied over the page instead, reading it with textureLoad so its channel order need not match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 035cf8643f5f10037b4c5de9d390000a4d40cb25 against base 3a4171a1020f4aebcb70002b919a14f9d9c17974. No actionable finding. The popup is clipped to the view, blended over a retained clean picture, and cleared on close; the existing shared-texture copy/acknowledgement handoff is retained for popup paints.
Verification: GitHub-only static review of lifecycle, composition, input paths and tests. I did not run CEF or GPU tests. The author reports the accelerated popup import path remains untested and one existing browser crash test failed on both this branch and main; I did not independently reproduce either.
(Written by review (OpenAI))
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed all 10 files (5 commits, 5527dea..035cf86) covering the CEF popup event path, the new GPU overlay composition, and its tests and docs.
- Helper popup events —
on_popup_show/on_popup_sizeforward the popup/close asEvent::Popup, and both paint paths now carry aLayer. - Overlay composition —
layers.rsclips the popup to the view (i64math, no OOB draw) and blends it premultiplied over a copy of the clean page, keeping the clean view for moves and closes. - Routing and uploads —
run.rsroutes popup paints throughLayersand redraws on area changes; CPU uploads addCOPY_SRCso both paint paths compose the same way. - Tests and docs — clip/device/dropdown tests added,
render-swruns the layer tests, the README limitation is dropped, and the completed quest file/entry are removed.
big-pickle (free) | 𝕏

Finishes quest/m0/browser-popups.md, raised on moq-dev/studio#8.
Problem
CEF paints a page's popup widgets, such as a
<select>'s list, apart from the page (PET_POPUP). The helper dropped those paints, so a dropdown opened invisibly and could not be picked from.README.mdcalled this out as a limitation.Approach
host.rs): forwardsPET_POPUPpaints like the view's, on bothOnPaint(pixels) andOnAcceleratedPaint(shared texture), tagged with aLayer.OnPopupSizeandOnPopupShow(false)becomeEvent::Popup(id, Some(area) | None). They go through the same per-page id andPaintedhandshake as the view.layers.rs,run.rs): each page's route keeps its newest clean view and, while one is open, the popup's area and picture.wgpu::Texture, so one pass serves both. It reads the popup withtextureLoad, so a popup's channel order need not match its page's.COPY_SRC; imported ones already have it.<select>over a blue source showed the blue scene through the page for 4 frames when its popup was copied. Blended, it never does.GetScreenInfohandler, CEF uses the view as the screen, so Chromium keeps the popup inside the view.clipdraws only the part that lands on the view, from the matching part of the picture, ini64, so no area makes an out-of-bounds draw. Sizes keep their existing bounds (MAX_MESSAGE, the device texture limit).window.openandtarget="_blank"stay cancelled, as the quest says.Cost: nothing while no popup is open. While one is open, each paint allocates one view-sized texture, makes one view-sized GPU copy, and draws one popup-sized pass. The two pipelines (RGBA and BGRA) are built once per helper start.
Impact
README.mddrops the "not drawn yet" note.moq_scene::browserexports are unchanged.Event::TextureandEvent::Pixelscarry aLayer, and there is a newEvent::Popup). Both ends come from the same binary, so there is nothing to migrate.just render-swalso runsbrowser::layers::tests::.Alternatives
copy_texture_to_texture(this PR's first version): simpler, but it punches transparent popup pixels through to the scene behind, as reproduced above.Invalidate(PET_VIEW)and a wait for a repaint. Not worth it for a widget open for seconds.Picturetype and the compositor for one source kind.Validation
just cipassed (163 tests) at035cf86.035cf86:cargo clippy --workspace --all-targets -D warningspassed with and withoutmoq-scene/capture,moq-studio/capture,moq-studio/openh264,moq-studio/cef.cargo nextest run -p moq-scene --features cef --lib browserpassed (10 tests, including the newcliptest).just render-sw:a_popup_blends_over_the_page_where_placed;a_dropdown_draws_and_takes_clicks.<select>and waits for its lime list to cover the page center. It then clicks an option and waits for the page'sonchangeto turn the page blue. That checks drawing, input into the popup, and the popup clearing on close.mainfails with "the center stayed [255, 0, 0, 255], not [0, 255, 0, 255]", so the list was never drawn.a_crash_drops_only_its_sourcefails with "renderer never failed" both on this branch and onmain(same command,just render-sw's browser step, nixos).dri_gbm.so: Permission denied), and no page paints at all, onmaintoo. The GPU branch is the same import call the view uses, with thePET_POPUPtype passed through, and the draw after import is shared with the CPU path. moq-dev/studio#8 validated the view's GPU path on an AMD GPU.Follow-ups
Review
Codex (
quest review), gpt-6.1-sol, medium effort. Session01a1a787.66974b0, 1 finding: "Alpha-blend the popup over the page" (layers.rs:66). Fixed ineaf0655and035cf86after reproducing it (transparent first paints showed the scene behind). The popup is now drawn premultiplied, with a device test.035cf86: no findings.(Written by Claude Opus 5.5)