Test code:
---
int main( int argc, char *argv[] )
{
SDL_Surface *orig = SDL_LoadPNG("testyuv.png");
SDL_Surface *surf16 = SDL_ConvertSurface(orig, SDL_PIXELFORMAT_RGB565);
SDL_Surface *surf32 = SDL_ConvertSurface(surf16, SDL_PIXELFORMAT_ARGB8888);
Uint64 then = SDL_GetTicks();
for (int i = 0; i < 100000; ++i) {
SDL_BlitSurface(surf16, NULL, surf32, NULL);
}
Uint64 now = SDL_GetTicks();
SDL_Log("Blit took %d ms\n", (int)(now - then));
return 0;
}
---
Results on my system:
BlitNtoN: Blit took 34522 ms
Blit_RGB565_32 (3 LUT): Blit took 9316 ms
Blit_RGB565_32 (1 LUT): Blit took 5268 ms
Blit_RGB565_32_SSE41: Blit took 1619 ms
The uclibc version of SDL_snprintf() is currently limited to values
<ULLONG_MAX due to the `unsigned long long` cast in SDL_PrintFloat(),
but it makes sense to at least ensure that it does support the full
unsigned 64-bit range. This also covers the one defined case where a
32-bit MSVC build can't assume that _ftoul2_legacy() == _ftol2().
SDL_CreateGPURenderer() now allows passing in an existing GPU device and passing in a NULL window to create an offscreen renderer.
Also renamed SDL_SetRenderGPUState() to SDL_SetGPURenderState().
The "as-installed" tests have metadata files in the .desktop-like format
used by gnome-desktop-testing, which uses a subset of shell syntax for
the Exec field. The list of arguments is represented as a
semicolon-separated list by CMake, but we need to convert that into a
space-separated list for the Exec field.
Strictly speaking we should be quoting the arguments with the equivalent
of Python's shlex.quote, but I couldn't find a way to do that in CMake,
and currently none of the tests have arguments that need quoting.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Full paths are used as-is, relative paths are prepended with SDL_GetAndroidInternalStoragePath(), and operations fall back to the asset system as appropriate.
This is consistent with the behavior of opening files on Android.
SDL_WaitEvent() will pump OS events if no poll sentinel is pending, so flush events before inserting a user event to ensure that the user event will be next in the queue.
Previously the test would kill the child process while it was in the process of initializing (loading DLLs, etc) and this would cause the test to fail.
The software renderer now matches the 3D renderer behavior by rendering a reversed rectangle (extending width or height in the opposite direction) when width or height is negative. It also now renders no rectangle if the width and height are 0.
Fixes https://github.com/libsdl-org/SDL/issues/13400