[gtk+/wip/alexl/broadway4] broadway: Add opacity node
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/alexl/broadway4] broadway: Add opacity node
- Date: Wed, 22 Nov 2017 16:33:05 +0000 (UTC)
commit c0625244e618403cd150aeae5a10f4eea2b39256
Author: Alexander Larsson <alexl redhat com>
Date: Wed Nov 22 17:28:44 2017 +0100
broadway: Add opacity node
gdk/broadway/broadway-protocol.h | 1 +
gdk/broadway/broadway.js | 14 ++++++++++++++
gdk/broadway/broadwayd.c | 4 ++++
gsk/gskbroadwayrenderer.c | 10 ++++++++++
4 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway-protocol.h b/gdk/broadway/broadway-protocol.h
index f1b1504..5dd5ba3 100644
--- a/gdk/broadway/broadway-protocol.h
+++ b/gdk/broadway/broadway-protocol.h
@@ -18,6 +18,7 @@ typedef enum { /* Sync changes with broadway.js */
BROADWAY_NODE_ROUNDED_CLIP = 6,
BROADWAY_NODE_LINEAR_GRADIENT = 7,
BROADWAY_NODE_SHADOW = 8,
+ BROADWAY_NODE_OPACITY = 9,
} BroadwayNodeType;
typedef enum {
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 57565d5..8f056c3 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -614,6 +614,20 @@ SwapNodes.prototype.handle_node = function(parent, offset_x, offset_y)
}
break;
+ case 9: // OPACITY
+ {
+ var opacity = this.decode_float();
+ var div = document.createElement('div');
+ div.style["position"] = "absolute";
+ div.style["left"] = px(0);
+ div.style["top"] = px(0);
+ div.style["opacity"] = opacity;
+
+ parent.appendChild(div);
+ this.handle_node(div, offset_x, offset_y);
+ }
+ break;
+
default:
alert("Unexpected node type " + type);
diff --git a/gdk/broadway/broadwayd.c b/gdk/broadway/broadwayd.c
index 6314ce9..7deb114 100644
--- a/gdk/broadway/broadwayd.c
+++ b/gdk/broadway/broadwayd.c
@@ -269,6 +269,10 @@ rewrite_node_textures (BroadwayClient *client,
pos += n_shadows * NODE_SIZE_SHADOW;
pos = rewrite_node_textures (client, len, data, pos);
break;
+ case BROADWAY_NODE_OPACITY:
+ pos += NODE_SIZE_FLOAT;
+ pos = rewrite_node_textures (client, len, data, pos);
+ break;
default:
g_assert_not_reached ();
}
diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c
index 49e4f77..5935b22 100644
--- a/gsk/gskbroadwayrenderer.c
+++ b/gsk/gskbroadwayrenderer.c
@@ -455,6 +455,16 @@ gsk_broadway_renderer_add_node (GskRenderer *self,
}
return;
+ case GSK_OPACITY_NODE:
+ {
+ add_uint32 (nodes, BROADWAY_NODE_OPACITY);
+ add_float (nodes, gsk_opacity_node_get_opacity (node));
+ gsk_broadway_renderer_add_node (self, nodes, node_textures,
+ gsk_opacity_node_get_child (node));
+ }
+ return;
+
+ case GSK_COLOR_MATRIX_NODE:
case GSK_TEXT_NODE:
default:
break; /* Fallback */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]