Skip to content

frontend: HDR screenshots through the platform facade (#883) - #1984

Merged
zackees merged 2 commits into
masterfrom
infra/883-screenshot
Oct 23, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/883-screenshot

Conversation

@zackees

@zackees zackees commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Refs #883 (step 5a: the 3 ScreenshotObj conditionals and its precompiled header's 1). Stacked on #1980; review only the last two commits.

  • ScreenshotColorSpace(source): Windows returns the source's space, with GS_CS_709_EXTENDED → GS_CS_709_SCRGB for JXR. macOS and X11 return GS_CS_SRGB (tonemap to SDR), as before.
  • SaveHdrScreenshot(path, pixels, cx, cy): on Windows, the UTF-8 → wide path plus SaveJxr. SaveJxrImage and SaveJxr are moved unchanged into platform-windows.cpp.hpp. macOS and X11 return false, and the caller releases the reserved file exactly as the old #else did.
  • Precompiled headers: the WIC includes and #pragma comment(lib, "windowscodecs.lib") move from frontend-utility-screenshotobj.pch.hpp (no host conditional left) to frontend-windows-platform.pch.hpp, after <windows.h>.

BUILD.md: this changes precompiled headers, so a full Windows and macOS build has to pass before merge. I dispatched ci.yml on infra/883-screenshot; Run https://github.com/obs-rust/obs-studio/actions/runs/40027816147 (pre-rebase commits; the rebase onto #1977/#1980 changed none of this PR's files): Windows x64, Windows arm64, macOS arm64 and macOS x86_64 app builds passed. Ubuntu failed in setup with a setup_ubuntu parse error from #1948, before compiling; that is fixed in #1988. Flatpak failed linking obs-browser.so, a file this PR doesn't touch. #1984's own Qt Frontend Linux lane compiled the frontend with this change.

  • RED b4aa6bf: test_hdr_screenshots_go_through_the_facade. Locally: FAILED (failures=1).
  • GREEN 4f2ef89: test OK. Ratchet: ScreenshotObj (3) and its PCH (1) leave the baseline. ./lint ok, including test_build_groups.

Left in #883 after this: output-filename-reserve.c.h (1, plus 2 in its PCH). Moving create_exclusive to host files means adding a source to test/cmocka/tests.d/test_output_filename_reserve.cmake, so I'm asking about that on the issue first.

Tiers 1-4 don't apply. Not user-visible.

RED: ScreenshotObj and its precompiled header still hold the Windows JXR
writer and the HDR color space choice under _WIN32.
ScreenshotColorSpace() and SaveHdrScreenshot() (platform.hpp) replace the
_WIN32 blocks in ScreenshotObj. platform-windows keeps scRGB for
GS_CS_709_EXTENDED and writes JXR through WIC as before (SaveJxrImage and
SaveJxr moved unchanged, with the WIC includes, into its precompiled
header); macOS and X11 render sRGB and have no HDR writer. ScreenshotObj
and its precompiled header leave the ratchet baseline.
@zackees
zackees force-pushed the infra/883-screenshot branch from 4f2ef89 to d26995b Compare October 23, 2026 22:12
@zackees
zackees enabled auto-merge October 23, 2026 22:12
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit b75948e Oct 23, 2026
30 checks passed
@zackees
zackees deleted the infra/883-screenshot branch October 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant