Browse Source

testcolorspace: don't tonemap from HDR to SDR when reading pixels

Our source content is in the SDR range, so we don't need to tonemap when reading it back.
Sam Lantinga 11 months ago
parent
commit
3f7f6f624b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      test/testcolorspace.c

+ 3 - 0
test/testcolorspace.c

@@ -157,6 +157,9 @@ static SDL_bool ReadPixel(int x, int y, SDL_Color *c)
 
     surface = SDL_RenderReadPixels(renderer, &r);
     if (surface) {
+        /* Don't tonemap back to SDR, our source content was SDR */
+        SDL_SetStringProperty(SDL_GetSurfaceProperties(surface), SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING, "*=1");
+
         if (SDL_ReadSurfacePixel(surface, 0, 0, &c->r, &c->g, &c->b, &c->a)) {
             result = SDL_TRUE;
         } else {