[gtk/wip/chergert/glproto: 888/920] inline isnan check




commit 80bdd98c2bf60f181ab8a26840a0749f7fbe5b76
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 3 15:41:09 2021 -0800

    inline isnan check

 gsk/next/gskglrenderjob.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 5af3ee3470..0959e0a6fb 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -223,13 +223,19 @@ init_full_texture_region (GskGLRenderOffscreen *offscreen)
   offscreen->area.y2 = 1;
 }
 
+static inline int
+_isnan_f (float x)
+{
+  return x != x;
+}
+
 static inline gboolean G_GNUC_PURE
 node_is_invisible (const GskRenderNode *node)
 {
   return node->bounds.size.width == 0.0f ||
          node->bounds.size.height == 0.0f ||
-         isnan (node->bounds.size.width) ||
-         isnan (node->bounds.size.height);
+         _isnan_f (node->bounds.size.width) ||
+         _isnan_f (node->bounds.size.height);
 }
 
 static inline void


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