shell: texture the launch splash from a pre-rendered sheet - #635
Merged
Conversation
deblasis
force-pushed
the
splash-stave
branch
4 times, most recently
from
August 15, 2026 06:32
8bd8ef8 to
d1ef189
Compare
deblasis
force-pushed
the
splash-stave
branch
8 times, most recently
from
August 15, 2026 16:04
86a4942 to
af69b30
Compare
Replaces the run-time engraver with one transformed blit. The sheet is drawn offline and shipped as an asset; all the splash does is pick a crop, a zoom and an angle, which is roughly a thousand GDI+ calls fewer on the path whose whole job is to be on screen before the app is. Varying the crop rather than the drawing turns out to be the better trade anyway: at this contrast a different piece of the same sheet is indistinguishable from a differently composed one, and it costs nothing. The texture is replaceable. A PNG at %APPDATA%\wintty\splash-texture.png is used instead of the shipped one, in the directory the config and themes already live in. Presence is the whole signal, so nothing has to work out whether the shipped sheet was tampered with, and the two being in different places means an upgrade replaces what it installed and never sees the user's copy. An ordinary picture has no alpha channel and would come out as one flat slab of ink, since the shipped sheet is a mask and alpha is what says how far towards the ink a pixel goes. For those, brightness says it instead. Decided from the pixel format rather than by reading pixels: this runs before the app is on screen. LaunchTexture and LaunchTextureSource are pure, so the things that fail invisibly are tested. A crop that runs off the sheet draws a hard edge across the splash. A turned image smaller than its window leaves a bare corner at some angles and window shapes but not others. A resolution order that came out backwards would ignore a customisation silently, which looks like the feature simply not working. Two more tests exist because the splash looked static in use and neither the code nor the other tests explained why: The seed is a clock, and a seeded Random turns a steadily moving seed into a steadily moving first draw -- its first value is very nearly linear in its seed. The angle came out as a slow sawtooth, about four degrees between launches a couple of seconds apart, which reads as no rotation at all. The seed is now avalanched before anything is drawn from it. The turn range is wide enough to look like a different angle each time but stays strictly inside a half turn either way, so the content is never inverted, and short of vertical at both ends, so it never stops reading as what it is. The sheet is a white-on-nothing mask tinted at draw time. The colour matrix maps it straight onto background and ink rather than blending over the background, and pins alpha to 1: UpdateLayeredWindow is called with an opaque source, so nothing here is allowed to depend on GDI+ blending having preserved it. Verified opaque on light and dark backgrounds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the run-time engraver with one transformed blit. The sheet is drawn
offline and shipped as an asset; the splash picks a crop, a zoom and an angle,
which is about a thousand GDI+ calls fewer on the path whose whole job is to be
on screen before the app is.
Varying the crop rather than the drawing is the better trade anyway. At this
contrast a different piece of the same sheet is indistinguishable from a
differently composed one, and it costs nothing.
Replaceable
A PNG at
%APPDATA%\wintty\splash-texture.pngis used instead of the shippedone, in the directory the config and themes already live in. Presence is the
whole signal, so nothing has to work out whether the shipped sheet was
tampered with, and the two being in different places means an upgrade replaces
what it installed and never sees the user's copy.
An ordinary picture has no alpha channel and would come out as one flat slab of
ink, since the shipped sheet is a mask and alpha is what says how far towards
the ink a pixel goes. For those, brightness says it instead. Decided from the
pixel format rather than by reading pixels, because this runs before the app is
on screen.
Tested
LaunchTextureandLaunchTextureSourceare pure, so the things that failinvisibly get tested. A crop that runs off the sheet draws a hard edge across
the splash. A turned image smaller than its window leaves a bare corner at some
angles and window shapes but not others. A resolution order that came out
backwards would ignore a customisation silently, which looks like the feature
simply not working.
Two of the tests exist because the splash looked static in use and neither the
code nor the other tests explained why:
The seed is a clock, and a seeded
Randomturns a steadily moving seed into asteadily moving first draw -- its first value is very nearly linear in its seed.
The angle came out as a slow sawtooth, about four degrees between launches a
couple of seconds apart, which reads as no rotation at all. The seed is now
avalanched before anything is drawn from it.
The turn range is wide enough to look like a different angle each time, but
strictly inside a half turn either way so the content is never inverted, and
short of vertical at both ends so it never stops reading as what it is.
Alpha
The sheet is a white-on-nothing mask tinted at draw time. The colour matrix maps
it straight onto the background and the ink rather than blending over the
background, and pins alpha to 1:
UpdateLayeredWindowis called with an opaquesource, so nothing here may depend on GDI+ blending having preserved it. Checked
offscreen on light and dark backgrounds, minimum alpha 255.