Split the blur into world, menu and widget blurs

The world or panorama keeps its animated background blur, while glass
behind menus and behind widgets (buttons, the dock, the account chip)
each get a fixed blur of their own. Glass is left out when its blur is 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-09-28 21:35:23 +02:00
co-authored by claude
parent 4d9c629eaf
commit 7bc308155e
10 changed files with 45 additions and 43 deletions
@@ -55,19 +55,33 @@ public interface RenderScope {
/**
* Frosts a rounded rectangle for a translucent background to be drawn over:
* the game behind the screen, blurred, cut to exactly the shape
* {@link #drawRoundedRectangle} draws. Draws nothing on versions without
* glass.
* the game behind the screen, blurred by {@code blur}, cut to exactly the
* shape {@link #drawRoundedRectangle} draws. Draws nothing on versions
* without glass.
*/
default void drawGlass(int x, int y, int width, int height, int radius) {
drawGlass(getRoundedRectangle(width, height, radius), x, y, width, height);
default void drawGlass(int x, int y, int width, int height, int radius, int blur) {
drawGlass(getRoundedRectangle(width, height, radius), x, y, width, height, blur);
}
/**
* Draws the blurred game behind the screen where {@code mask}, stretched
* over the area, is opaque.
* Draws the game behind the screen, blurred by {@code blur}, where
* {@code mask}, stretched over the area, is opaque.
*/
default void drawGlass(IdentifierRef mask, int x, int y, int width, int height) {
default void drawGlass(IdentifierRef mask, int x, int y, int width, int height, int blur) {
}
/**
* A {@link #drawRoundedRectangle} with a border, frosted with glass blurred
* by {@code blur} when the background isn't solid. A blur of 0 leaves it
* plain, showing the screen's own background blur.
*/
default void drawGlassRectangle(int x, int y, int width, int height, int radius, int blur, int thickness,
int background, int border) {
if (blur > 0 && background >>> 24 < 0xFF) {
drawGlass(x, y, width, height, radius, blur);
}
drawRoundedRectangle(x, y, width, height, radius, thickness, background, border);
}
/**