[gtk/wip/matthiasc/gsk-hdr] Revise the format check



commit 90831220d72faa41f1830f697b961cf14a547629
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 6 11:27:34 2021 -0400

    Revise the format check
    
    We can just look at the bytes-per-pixel,
    and maybe we will get bits-per-component later.

 gdk/gdkgltexture.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c
index a3b7037976..4e5d210829 100644
--- a/gdk/gdkgltexture.c
+++ b/gdk/gdkgltexture.c
@@ -348,7 +348,10 @@ gdk_gl_texture_is_hdr (GdkTexture *texture)
 
   gdk_gl_texture_run (self, gdk_gl_texture_get_format, &result);
 
-  return gdk_memory_format_is_hdr (result.format);
+  /* We really want to check bits-per-component.
+   * For now, this gives the right answer.
+   */
+  return gdk_memory_format_bytes_per_pixel (result.format) > 4;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]