Don't assume HDR headroom for HDR10 surfaces

Applications that support HDR will set the correct values for their content.
This commit is contained in:
Sam Lantinga
2024-03-02 15:02:17 -08:00
parent c74f273848
commit 7f9ff6277c
4 changed files with 16 additions and 35 deletions

View File

@@ -157,9 +157,6 @@ static SDL_bool ReadPixel(int x, int y, SDL_Color *c)
surface = SDL_RenderReadPixels(renderer, &r);
if (surface) {
/* We don't want to do any HDR -> SDR tone mapping */
SDL_SetFloatProperty(SDL_GetSurfaceProperties(surface), SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT, 0.0f);
if (SDL_ReadSurfacePixel(surface, 0, 0, &c->r, &c->g, &c->b, &c->a) == 0) {
result = SDL_TRUE;
} else {