Skip to content

Studio: reduce Liquid Glass paint cost when WebKit paints on the CPU - #16960

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
oobabooga:studio-liquid-glass-cpu-paint
Nov 10, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
oobabooga:studio-liquid-glass-cpu-paint

Conversation

@oobabooga

Copy link
Copy Markdown
Member

When WebKit paints on the CPU (the Linux app without GPU rendering, including the AppImage's bundled WebKitGTK 2.50.4), Liquid Glass 3D is several times slower than Glass off. The cost is its decoration, not the glass blur. This PR makes that decoration cheap to paint, with a nearly unchanged look.

  • Cause 1, blurred inset shadows: the Liquid Glass 3D rim (--glass-rim) and the light-glass control edge (--glass-light-inner, on every field, select and card) are inset box-shadows with a blur. WebKit's CPU painter re-blurs them over the element's whole area on every repaint, whatever the radius. A perf profile of scrolling Settings puts 65% of the web process's time in BackgroundPainter::paintBoxShadow, inside Skia's blur filter.
  • Cause 2, radial sheens: on WebKitGTK 2.50.4, the radial gradients of --glass-sheen cost most of what remains once the shadows are gone.
  • Fix: rims and edges keep their 1px lines with no blur, the two large soft glows are dropped, the pill under-glow and the plain-glass light menu glow become 1px lines, and every Liquid sheen is one linear gradient. CSS tokens only, on every platform.
  • Not covered: an enabled Glass lens (Magnify or Shrink) keeps its own blurred edge and filtered wallpaper copies.

#16921's layer flag does not help here: in WebKitGTK, Settings scrolling with Liquid Glass 3D measured the same with and without it.

Measurements

main 1a4e758e9d vs this commit, both built. Real Studio UI in WebKitGTK without GPU rendering, 4 cores, light theme, a background image, Glass lens Off, a 100-turn chat open. Typing is keydown to the second following frame.

Liquid Glass 3D main this PR Glass off
WebKitGTK 2.50.4 (AppImage): Settings scroll, per frame 218 ms 53 ms 49 ms
WebKitGTK 2.50.4: chat wheel scroll 17.8 fps 29.5 fps 42 fps
WebKitGTK 2.50.4: typing 81 ms 41 ms 20 ms
WebKitGTK 2.52.6: Settings scroll, per frame 66 ms 26 ms 25 ms
WebKitGTK 2.52.6: chat wheel scroll 26.6 fps 39.7 fps 44 fps
WebKitGTK 2.52.6: typing 50 ms 25 ms 19 ms

Frosted is unchanged; plain Liquid Glass improves slightly. The remaining gap to Glass off is the translucent surfaces themselves.

Screenshots

main vs this PR, Chromium at 2x. Frosted is pixel-identical; the other pairs differ by a mean of 0.25 to 0.85 per channel (of 255) and at most 16, on rims, edges and highlights.

Settings over a new chat, Liquid Glass 3D light and dark, before and after

Composer, Liquid Glass 3D light and dark, Liquid Glass and Frosted, before and after

Testing

  • New test in tests/window-material.test.ts: the glass rules contain no blurred inset shadow and no radial sheen (main has 20 and 8); the sheen and light-glass edge tests pin the new values.
  • Window material, composer outline and glass layer tests (49) and typecheck pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T20:13:57.128208Z 6f7d52d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 6f7d52da8b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants