common: add aspect ratio helper code
This is sufficiently nontrivial and often-needed enough that providing helpers makes a lot of sense. Add some extra helpers that come up when rendering to sub-rects of targets. The only annoying thing here is the mismatch between pl_rect2df and pl_rect2d. Maybe I can come up with a better API here? Also update the sdl2 demo to actually preserve the aspect ratio, as well as add some test cases to the new helper functions.
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
Build | |||||||||
passed |
#396682
aarch64
docker
|
build-aarch64 |
00:00:34
|
|
|||||
passed |
#396683
macos
|
build-macos |
00:00:09
|
|
|||||
passed |
#396678
amd64
docker
|
build-ubuntu |
00:00:45
|
|
|||||
passed |
#396679
amd64
docker
|
build-ubuntu-static |
00:00:44
|
|
|||||
passed |
#396680
amd64
docker
|
build-win32 |
00:00:16
|
|
|||||
passed |
#396681
amd64
docker
|
build-win64 |
00:00:17
|
|
|||||
Test | |||||||||
passed |
#396685
gpu
|
test-gpu |
00:01:32
|
77.0008% |
|
||||
passed |
#396686
gpu
|
test-gpu-asan |
00:01:54
|
|
|||||
passed |
#396687
gpu
|
test-gpu-msan |
00:01:35
|
|
|||||
passed |
#396688
gpu
|
test-gpu-ubsan |
00:01:31
|
|
|||||
passed |
#396684
amd64
docker
|
test-ubuntu-scan |
00:00:32
|
|
|||||