Skip to content

feat: Optimise window show time OS-20603#121

Open
t-bashir-bs wants to merge 1 commit into28-x-y-bsfrom
tbashir/28-x-y-bs-optimise-window-show-OS-20603
Open

feat: Optimise window show time OS-20603#121
t-bashir-bs wants to merge 1 commit into28-x-y-bsfrom
tbashir/28-x-y-bs-optimise-window-show-OS-20603

Conversation

@t-bashir-bs
Copy link

@t-bashir-bs t-bashir-bs commented Mar 4, 2026

Description of Change

The changes in this PR are optimisations to reduce the time for doing a show from ~180ms on series 5 and ~60ms on series 4 to about 10ms. The result is that we are now inline with QtWebEngine.
The two main changes that result in this optimisation are:

  1. Changing show/hide to be implemented by changing the opacity to 0. This change is in the default-electron-app.
  2. Removing an optimisation from Chromium that causes the compositor to skip compositing when the window-level opacity is 0 (feat_brightsign_keep_compositing_active_for_window-level_zero.patch) - this applies to series 4 & 5.

Another issue was found that when the opacity is set to 0 at a wayland surface level the opacity is still set to 1. This results in the plane assignment code to assign a plane for the transparent (hidden window). This has been fixed using patch fix_brightsign_window-level_opacity_not_applied_via_zcr_blending_v1.patch, together with a small fix in the Weston compositor.

Finally, it was found that the way the code in patch fix_wayland_window_call_setwindowgeometry_for_position_updates.patch had been done can result in wayland buffers being destroyed and recreated, which adds a delay. The patch has been updated with an improved change to achieve the same thing.

Checklist

Release Notes

Notes:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces BrightSign-focused Chromium/Electron patch updates to reduce Wayland window “show” latency by switching hide/show to opacity-based behavior while ensuring the compositor continues producing frames and that window-level opacity/position changes propagate correctly.

Changes:

  • Keep Chromium compositing/tiling/raster active for “window-level” effect nodes even when opacity is 0.
  • Fix Wayland window-level opacity so it survives frame playback and applies to both root + subsurfaces.
  • Refine Wayland position-only bounds updates to commit window geometry without triggering buffer reallocation delays.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
patches/chromium/fix_wayland_window_call_setwindowgeometry_for_position_updates.patch Updates Wayland to commit geometry on position-only changes to avoid frame/buffer churn.
patches/chromium/fix_brightsign_window-level_opacity_not_applied_via_zcr_blending_v1.patch Adds window-level opacity plumbing (GetWindowOpacity + multiplication during frame playback) and blending enforcement for effective opacity.
patches/chromium/feat_brightsign_keep_compositing_active_for_window-level_zero.patch Prevents EffectTree from marking window-level nodes “not drawn” when opacity is 0, avoiding raster restart delays.
patches/chromium/.patches Registers the two new Chromium patches in the patch application list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +99 to +101
+ // Window-level opacity set via SetOpacity(). Applied to the root surface
+ // during frame playback by multiplying into the per-frame config opacity.
+ float window_opacity_ = 1.0f;
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the window-level opacity is applied only to the root surface, but in this patch the opacity is multiplied into config.opacity inside WaylandFrameManager::ApplySurfaceConfigure() for every surface (root and subsurfaces). Update this comment to match the actual behavior so future readers don’t assume subsurfaces are unaffected.

Copilot uses AI. Check for mistakes.
Comment on lines +130 to +131
+ // from the per-frame overlay config opacity and is multiplied into the root
+ // surface opacity during frame playback.
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc comment says the window-level opacity is multiplied into the root surface opacity, but the patch applies the multiplication in ApplySurfaceConfigure() for both the root surface and all subsurfaces. Adjust the wording to reflect that it applies across all surfaces of the window.

Suggested change
+ // from the per-frame overlay config opacity and is multiplied into the root
+ // surface opacity during frame playback.
+ // from the per-frame overlay config opacity and is multiplied into the
+ // opacity applied to the root surface and all subsurfaces during frame
+ // playback.

Copilot uses AI. Check for mistakes.
@t-bashir-bs t-bashir-bs force-pushed the tbashir/28-x-y-bs-optimise-window-show-OS-20603 branch from d2d6641 to 14d1e34 Compare March 6, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants