Commit 9e5a22bb authored by Alexander Larsson's avatar Alexander Larsson
Browse files

broadway: Add opacity node

parent 9b1f6acc
......@@ -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 {
......
......@@ -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);
......
......@@ -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 ();
}
......
......@@ -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 */
......
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