浏览代码

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 7 月之前
父节点
当前提交
3f7f6f624b
共有 1 个文件被更改,包括 3 次插入0 次删除
  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 {