Repository navigation
Conversation
The renderer's own HiDPI check, shared by the Kotlin/Native Windows and Linux renderers and the JVM tests: the marker scene (white, 1 dp black bars at whole dp, a 40 dp circle, a 12 dp rounded clip and "Hg" at 16 sp), Compose's offscreen drawing of it at a density, a bilinear stretch for the negative control, and the measurements each criterion makes (criteria 1 to 6): surface against client size and density, the screen against the drawn frame (mean <= 1 level, <= 0.1% over 8), whole pixel bars at s = 1 and 2, the screen against offscreen Compose at fractional scales with a stretched 1x frame that must fail, the width of curved and glyph edges, and the redraw after a scale change. HiDpiCheckTest runs the measurements on pictures whose answer is known: Compose's scene at 1, 1.25, 1.5 and 2 passes; the 1x scene stretched, an aliased copy, a soft stroke and pictures past the 0.1% limit fail.
The Kotlin/Native Windows renderer runs the HiDPI check in its own window when COMPOSE_RUST_FR82_CHECK is set, in place of the application: it reads the scale with GetDpiForWindow, the client area with GetClientRect, and the screen from the composed desktop after DwmFlush, and reads each frame back from the swapchain buffer (or the CPU resize frame) to compare. It also checks that the window's DPI awareness context is per-monitor v2 and its DPI 192 at 200% (criterion 7). Win32Window's loop body becomes step(), which run() calls, so the check drives the real loop. compose-rust/tests/fixtures/hidpi is the program it runs in, built with and without compose-rust's manifest. The windows-hidpi job of the native renderer test takes the windows-static kit, builds both, and .github/scripts/hidpi-windows-check.sh runs them at 100, 125, 150 and 200% (set-display-scale.exe), then once from 200% to 125% and back while it runs (criterion 6, WM_DPICHANGED), asserting every check named for each scale said ok. Covers criteria 1 to 7 on Windows; not run yet.
The Kotlin/Native Linux renderer runs the same HiDPI check in its own X11 window when COMPOSE_RUST_FR82_CHECK is set. On a connection of its own it finds the window by name, reads Xft.dpi from the root window's RESOURCE_MANAGER for the scale, the window's attributes for its size, and XGetImage for the screen; each frame is read back from the GL canvas before it is presented. LinuxWindow now redraws when the window reports a scale change (onScaleChanged, forwarded by the handoff listener): the fork's X11 window follows Xft.dpi, but nothing in the scene invalidates, so the old frame stayed on the screen until something else asked for one. The Linux job of the Kotlin/Native desktop renderer test builds the hidpi fixture and .github/scripts/hidpi-linux-check.sh runs it under Xvfb at Xft.dpi 96, 120, 144 and 192 (xrdb -merge), then once from 192 to 120 and back while it runs. Covers criteria 1 to 6 on Linux; not run yet.
…R-82, #18) Criterion 8 runs on CI only if the runner's virtual display can be switched to two pixels to a point with CGConfigureDisplayWithDisplayMode. macos-display-modes lists every mode CGDisplayCopyAllDisplayModes returns with kCGDisplayShowDuplicateLowResolutionModes and says whether one has a pixel width twice its point width. The macOS job of the Kotlin/Native desktop renderer test runs it first and writes the answer to the step summary; it changes nothing.
|
Expected red on the dispatched run: the Linux live-scale step (fr82_scale_change_redraws_at_the_new_scale, dp size before and after) fails until the fork keeps a window's dp size across a scale change. p1B has that fix in progress for both X11 windows (Xvfb test 640x480 -> 1280x960); it lands after ext.3, so it reaches this repo with the next window pin. Every other fr82 line is expected green; a red elsewhere is a real finding. |
The dispatched run printed 'xrdb: no Xft.dpi' at every scale and ran everything at scale 1: Xvfb resets when its last client disconnects, dropping the root window's resources that xrdb had just written. The step now starts Xvfb with -noreset, and the script fails when a setting does not stay, so scale 1 cannot pass as every scale.
…18) FR-82 criterion 4 compares the screen at a fractional scale with Compose drawn offscreen at that density with the same fonts and raster settings, under criterion 2's tolerance. The reference was drawn with Skia's CPU backend while the window draws through GL (llvmpipe on CI) or Direct3D, so antialiased edges differed by a level or two: 0.17% of pixels over 8 levels at 1.25 and 0.11% at 1.50 on the Linux job, against a 0.1% limit, while the screen equalled the drawn frame exactly. The reference and the 1x stretched control are now drawn through a HiDpiSurface the window supplies: on Linux the window's own back buffer, through its GLX and Skia contexts and the props its frames use, never presented; on Windows a render target on the window's Direct3D context with the swapchain's colour type, origin and pixel geometry. The CPU backend is kept only for a window without a GPU context. The check's line says which path drew the reference. The tolerance is unchanged.
…fr82-ci # Conflicts: # .github/workflows/test-kn-desktop-renderer.yml # .github/workflows/test-native-renderer.yml
…FR-82) Under ci.yml the windows-static job is skipped because the kit is already an artifact of the run, and a job whose need was skipped is skipped too. Accept a skipped windows-static the way package-windows-host.yml does.
|
Local merge gate on head One merge fix,
Only CI can prove (ci.yml suites, run with
|
# Conflicts: # CHANGELOG.md # renderer/windows/src/Win32Window.kt
…ndow's size in dp (FR-82) The window pin moves from 96ae925 to ea0880c (fork #243), which still publishes as 1.11.1-ext.5. On WM_DPICHANGED the Windows window now restates the size it remembers at the new scale instead of applying the rectangle Windows scaled from the outer frame, so a 320x240 dp window at 200% is 400x300 px at 125% rather than 398x297, the failure the FR-82 Windows HiDPI job reported. Window C only (win32_window.c and the new win32_dpi.h); REVISION and MINGW_REVISION stay at 96ae925, so the change lists do not move.
Refs #18
Builds on #808 (the Compose fork's 1.11.1-ext.4). This branch merges
feat/compose-ext4, which moves the Compose pin to the fork'sv1.11.1-ext.4tag (cadc5984) and the window pin (WINDOW_REVISION) to the tip ofextendedata13a6289, all published as1.11.1-ext.4. That window carries fork PR #216: after anXft.dpichange the Kotlin/NativeX11Window(extended/window/native/linux/src/X11Window.kt,scaleChanged) and the GraalVMx11_window.cresize the window to its size in points times the new scale (X11Scale.sizeAtScaleinextended/window/common), state the size hints again and measure at the new size and scale before the frame. The Linux live-scale check,fr82_scale_change_redraws_at_the_new_scale, which was expected red at ext.3 because the window kept its size in pixels, is now expected green. Merge #808 first; this diff then shows only the FR-82 work.The CI-checkable acceptance criteria of FR-82 as
fr82_*checks. The renderer checks its own window: it draws a marker scene (white, 1 dp black bars at whole dp, a 40 dp circle, a 12 dp rounded clip, "Hg" at 16 sp), reads the screen and the drawn frame back, and prints onecompose-rust: fr82_<check> scale=<s>: ok|FAILED <measurements>line per check.renderer/desktop/src/HiDpiCheck.kt, symlinked into the Windows and Linux renderers): the scene, offscreen Compose at a density, a bilinear stretch for the negative control, the measurements and the order of the checks (criteria 1 to 6).HiDpiCheckTest(JVM) runs the measurements on pictures whose answer is known: Compose at 1, 1.25, 1.5 and 2 passes, while a stretched 1x frame, an aliased copy, a soft stroke and pictures past the 0.1% limit fail.Fr82WindowsCheck.kt): GetDpiForWindow, GetClientRect, the composed desktop after DwmFlush, the swapchain buffer read back, plus per-monitor v2 awareness (criterion 7).Win32Window.run()'s loop body is nowstep(). The reference is drawn on the window's own Direct3D context. Awindows-hidpijob in the native renderer test takes the windows-static kit, buildscompose-rust/tests/fixtures/hidpiwith and without the manifest, and.github/scripts/hidpi-windows-check.shruns it at 100, 125, 150 and 200% (set-display-scale), then from 200% to 125% and back while it runs.Fr82LinuxCheck.kt): Xft.dpi from RESOURCE_MANAGER, the window's attributes, XGetImage.LinuxWindownow redraws ononScaleChanged; before this, nothing redrew after an Xft.dpi change. The fork's window asks for a frame on a scale change, but the renderer's loop draws only on its own conditions, so the redraw stays here..github/scripts/hidpi-linux-check.shruns in the Linux job of the Kotlin/Native desktop test at Xft.dpi 96, 120, 144 and 192, then from 192 to 120 and back..github/scripts/macos-display-modes.creports whether the runner offers a HiDPI mode (criterion 8's first step). The macOS sharpness check itself is not written in this PR.CHANGELOG.mdgains an entry.CI design
Development CI is now one manually dispatched workflow,
ci.yml, calling reusable suites. The merge took the develop side of both trigger conflicts:test-native-renderer.ymlandtest-kn-desktop-renderer.ymlareworkflow_callonly (the native one also keeps itsv*tag push), with nopull_request,scheduleor concurrency of their own. The PR's own jobs and steps (windows-hidpi, the Linux HiDPI steps, the macOS display modes step) sit inside those suites, so the leader'sci.ymldispatch runs them; therun-heavy-cilabel no longer starts anything. Thechangedjob builds on any dispatched run, and its path list for tag-less pushes now names the HiDPI fixture and scripts.Checked here (script tests, no build)
ci-on-demand,ci-pr-gate,native-needs-macos,needs-macos,no-em-dash,no-spec-citations,renderer-symlinks,spec-cites-real-tests,desktop-c-symbols,linux-native-window,x11-window-frames,x11-window-layout,x11-key-codes,win32-renderer-parity,windows-kotlin-native,compose-fork,fork-versions,fork-dependencies,naming-conventions,planning-docs,linux-window-default,fr53-windows-backend, with the window sources ata13a6289fromscripts/fetch-fork-window.sh. All pass.Merge gate for the builder
HiDpiCheckTest.Only CI can prove (Windows, Linux)
ci.ymldispatch on this head: the Linux job of the Kotlin/Native desktop test (hidpi-linux-check.shunder Xvfb, now includingfr82_scale_change_redraws_at_the_new_scaleat 1.25 and 2.00) and thewindows-hidpijob (four scales, with and without the manifest, and the 200% to 125% change). Everyfr82_*line is expected green; a red is a real finding.