[gtk+/wip/alexl/broadway4: 92/96] broadway: Add clip node
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/alexl/broadway4: 92/96] broadway: Add clip node
- Date: Thu, 23 Nov 2017 09:54:00 +0000 (UTC)
commit b74959a605f89d1c515db2b42181b27cc76ce8e6
Author: Alexander Larsson <alexl redhat com>
Date: Wed Nov 22 17:40:39 2017 +0100
broadway: Add clip node
gdk/broadway/broadway-protocol.h | 1 +
gdk/broadway/broadway.js | 11 +++++++++++
gdk/broadway/broadwayd.c | 4 ++++
gsk/gskbroadwayrenderer.c | 9 +++++++++
4 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway-protocol.h b/gdk/broadway/broadway-protocol.h
index 5dd5ba3..7e8a37c 100644
--- a/gdk/broadway/broadway-protocol.h
+++ b/gdk/broadway/broadway-protocol.h
@@ -19,6 +19,7 @@ typedef enum { /* Sync changes with broadway.js */
BROADWAY_NODE_LINEAR_GRADIENT = 7,
BROADWAY_NODE_SHADOW = 8,
BROADWAY_NODE_OPACITY = 9,
+ BROADWAY_NODE_CLIP = 10,
} BroadwayNodeType;
typedef enum {
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 8f056c3..9f9ca23 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -628,6 +628,17 @@ SwapNodes.prototype.handle_node = function(parent, offset_x, offset_y)
}
break;
+ case 10: // CLIP
+ {
+ var rect = this.decode_rect();
+ var div = document.createElement('div');
+ div.style["position"] = "absolute";
+ set_rect_style(div, rect, offset_x, offset_y);
+ div.style["overflow"] = "hidden";
+ parent.appendChild(div);
+ this.handle_node(div, rect.x, rect.y);
+ }
+ break;
default:
alert("Unexpected node type " + type);
diff --git a/gdk/broadway/broadwayd.c b/gdk/broadway/broadwayd.c
index 7deb114..50d71f5 100644
--- a/gdk/broadway/broadwayd.c
+++ b/gdk/broadway/broadwayd.c
@@ -259,6 +259,10 @@ rewrite_node_textures (BroadwayClient *client,
pos += NODE_SIZE_RRECT;
pos = rewrite_node_textures (client, len, data, pos);
break;
+ case BROADWAY_NODE_CLIP:
+ pos += NODE_SIZE_RECT;
+ pos = rewrite_node_textures (client, len, data, pos);
+ break;
case BROADWAY_NODE_LINEAR_GRADIENT:
pos += NODE_SIZE_RECT + 2 * NODE_SIZE_POINT;
n_stops = data[pos++];
diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c
index f4fe8a9..0838a7a 100644
--- a/gsk/gskbroadwayrenderer.c
+++ b/gsk/gskbroadwayrenderer.c
@@ -582,6 +582,15 @@ gsk_broadway_renderer_add_node (GskRenderer *self,
}
return;
+ case GSK_CLIP_NODE:
+ {
+ add_uint32 (nodes, BROADWAY_NODE_CLIP);
+ add_rect (nodes, gsk_clip_node_peek_clip (node));
+ gsk_broadway_renderer_add_node (self, nodes, node_textures,
+ gsk_clip_node_get_child (node));
+ }
+ return;
+
case GSK_COLOR_MATRIX_NODE:
case GSK_TEXT_NODE:
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]