common: make the atlas repack shared and testable
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 16s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / host-linux (push) Failing after 18s
build / host-windows-cross (push) Failing after 18s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 16s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / host-linux (push) Failing after 18s
build / host-windows-cross (push) Failing after 18s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Moves the per-display copy out of the XCB backend into common so it can be unit tested directly and reused by other backends. The test uses a unique value per source pixel, so a copy landing at the wrong offset cannot pass by coincidence, and checks truncation against guard bytes. Also adds a scripted end-to-end test and teaches the verification tool to report a blank capture source as a skip rather than a failure.
This commit is contained in:
1 parent
ba32d48a6a
commit
faaf63bc93
6 files changed
+354
-42
No files matched your search
@@ -78,6 +78,31 @@ bool lgDisplaysPack(
|
||||
unsigned * desktopWidth,
|
||||
unsigned * desktopHeight);
|
||||
|
||||
/**
|
||||
* Copy each display out of a captured virtual desktop image and into its slot
|
||||
* in the packed atlas.
|
||||
*
|
||||
* `srcX`/`srcY` give each display's position in the source image, which is not
|
||||
* generally its position in the atlas, nor its normalised desktop position.
|
||||
*
|
||||
* Copies are clipped to both the source image and `dstHeight`, so a
|
||||
* destination too small for the whole atlas truncates safely rather than
|
||||
* overrunning. Atlas padding owned by no display is left untouched.
|
||||
*/
|
||||
void lgDisplaysRepack(
|
||||
uint8_t * dst,
|
||||
unsigned dstPitch,
|
||||
unsigned dstHeight,
|
||||
const uint8_t * src,
|
||||
unsigned srcPitch,
|
||||
unsigned srcWidth,
|
||||
unsigned srcHeight,
|
||||
const KVMFRDisplay * displays,
|
||||
const uint32_t * srcX,
|
||||
const uint32_t * srcY,
|
||||
unsigned count,
|
||||
unsigned bytesPerPixel);
|
||||
|
||||
/**
|
||||
* Returns the index of the display in `displays` containing the virtual
|
||||
* desktop point (x, y), or -1 if the point falls in a gap between displays.
|
||||
|
||||
Reference in new issue
Block a user