Commit 12d3cd8f authored by Alexander Larsson's avatar Alexander Larsson
Browse files

broadway: Handle cairo nodes

This means we can directly upload these as textures, rather than
create a new surface and draw it into that. We still have to upload,
but there isn't a lot we can do about this as for these nodes
we generally redraw everything each time.
parent 4d1eca0d
......@@ -492,6 +492,25 @@ gsk_broadway_renderer_add_node (GskRenderer *self,
}
return;
case GSK_CAIRO_NODE:
{
const cairo_surface_t *surface = gsk_cairo_node_peek_surface (node);
GdkTexture *texture;
guint32 texture_id;
texture = gdk_texture_new_for_surface ((cairo_surface_t *)surface);
g_ptr_array_add (node_textures, g_object_ref (texture)); /* Transfers ownership to node_textures */
texture_id = gdk_broadway_display_ensure_texture (display, texture);
add_uint32 (nodes, BROADWAY_NODE_TEXTURE);
add_float (nodes, node->bounds.origin.x);
add_float (nodes, node->bounds.origin.y);
add_float (nodes, node->bounds.size.width);
add_float (nodes, node->bounds.size.height);
add_uint32 (nodes, texture_id);
}
return;
case GSK_CONTAINER_NODE:
{
guint i;
......
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