diff --git a/gdk/broadway/broadway-protocol.h b/gdk/broadway/broadway-protocol.h index 4d9941793e..baead88ce4 100644 --- a/gdk/broadway/broadway-protocol.h +++ b/gdk/broadway/broadway-protocol.h @@ -14,6 +14,7 @@ typedef enum { /* Sync changes with broadway.js */ BROADWAY_NODE_COLOR, BROADWAY_NODE_BORDER, BROADWAY_NODE_OUTSET_SHADOW, + BROADWAY_NODE_INSET_SHADOW, } BroadwayNodeType; typedef enum { diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js index 89e4e9da65..926f56bda5 100644 --- a/gdk/broadway/broadway.js +++ b/gdk/broadway/broadway.js @@ -492,6 +492,23 @@ SwapNodes.prototype.handle_node = function(parent) } break; + case 5: // INSET_SHADOW + { + var rrect = this.decode_rounded_rect(); + var color = this.decode_color(); + var dx = this.decode_float(); + var dy = this.decode_float(); + var spread = this.decode_float(); + var blur = this.decode_float(); + + var div = document.createElement('div'); + div.style["position"] = "absolute"; + set_rrect_style(div, rrect, null); + div.style["box-shadow"] = args("inset", px(dx), px(dy), px(blur), px(spread), color); + parent.appendChild(div); + } + break; + default: alert("Unexpected node type " + type); } diff --git a/gdk/broadway/broadwayd.c b/gdk/broadway/broadwayd.c index de3d628265..c54f86b4bf 100644 --- a/gdk/broadway/broadwayd.c +++ b/gdk/broadway/broadwayd.c @@ -239,6 +239,7 @@ rewrite_node_textures (BroadwayClient *client, case BROADWAY_NODE_BORDER: pos += NODE_SIZE_RRECT + 4 * NODE_SIZE_FLOAT + 4 * NODE_SIZE_COLOR; break; + case BROADWAY_NODE_INSET_SHADOW: case BROADWAY_NODE_OUTSET_SHADOW: pos += NODE_SIZE_RRECT + NODE_SIZE_COLOR + 4 * NODE_SIZE_COLOR; break; diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c index c89f1848e5..7a19185c32 100644 --- a/gsk/gskbroadwayrenderer.c +++ b/gsk/gskbroadwayrenderer.c @@ -210,6 +210,18 @@ gsk_broadway_renderer_add_node (GskRenderer *self, } return; + case GSK_INSET_SHADOW_NODE: + { + add_uint32 (nodes, BROADWAY_NODE_INSET_SHADOW); + add_rounded_rect (nodes, gsk_inset_shadow_node_peek_outline (node)); + add_rgba (nodes, gsk_inset_shadow_node_peek_color (node)); + add_float (nodes, gsk_inset_shadow_node_get_dx (node)); + add_float (nodes, gsk_inset_shadow_node_get_dy (node)); + add_float (nodes, gsk_inset_shadow_node_get_spread (node)); + add_float (nodes, gsk_inset_shadow_node_get_blur_radius (node)); + } + return; + default: { cairo_surface_t *surface;