[gtk] gsk: Make GskColorStop.offset a float
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gsk: Make GskColorStop.offset a float
- Date: Tue, 7 Jan 2020 16:38:53 +0000 (UTC)
commit d7df56b6cbf01184543f84678733d78bc0510d2c
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]