Commit b74959a6 authored by Alexander Larsson's avatar Alexander Larsson
Browse files

broadway: Add clip node

parent 7a180f55
......@@ -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 {
......
......@@ -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);
......
......@@ -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++];
......
......@@ -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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment