[gtk/wip/baedert/gl-rework: 27/47] gsk: Make GskColorStop.offset a float



commit 9f97f49b8b8be80e89a7b2816538c841f82f0839
Author: Timm Bäder <mail baedert org>
Date:   Tue Dec 17 18:10:38 2019 +0100

    gsk: Make GskColorStop.offset a float
    
    Doesn't make sense for this to be double if everything else is float.
    Also makes it possible to 'easily' pass this to the GPU.

 gsk/gskrendernode.h       | 2 +-
 gsk/gskrendernodeparser.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index 0c4e73706e..a416785b8c 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -41,7 +41,7 @@ typedef struct _GskShadow               GskShadow;
 
 struct _GskColorStop
 {
-  double offset;
+  float offset;
   GdkRGBA color;
 };
 
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index 6a71db961f..02959bce93 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -433,9 +433,13 @@ parse_stops (GtkCssParser *parser,
 
   for (;;)
     {
-      if (!gtk_css_parser_consume_number (parser, &stop.offset))
+     double dval;
+
+      if (!gtk_css_parser_consume_number (parser, &dval))
         goto error;
 
+      stop.offset = dval;
+
       if (!gdk_rgba_parser_parse (parser, &stop.color))
         goto error;
 


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