Add a test for opacity render nodes

This test currently fails with the Vulkan renderer, despite
having its own reference image.
This commit is contained in:
Matthias Clasen
2017-10-18 01:22:27 +08:00
parent 99f42bb72e
commit 82e33823a9
4 changed files with 34 additions and 0 deletions

View File

@@ -65,6 +65,9 @@ test_data = [
'transform.node',
'transform.png',
'transform.vulkan.png',
'opacity.node',
'opacity.png',
'opacity.vulkan.png',
]
if get_option('install-tests')

BIN
testsuite/gsk/opacity.node Normal file

Binary file not shown.

BIN
testsuite/gsk/opacity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -411,6 +411,36 @@ transform (void)
return container;
}
static GskRenderNode *
opacity (void)
{
GskRenderNode *child;
GskRenderNode *node;
GskRenderNode *nodes[5];
GskRenderNode *container;
graphene_matrix_t matrix;
int i;
child = ducky ();
for (i = 0; i < 5; i++)
{
node = gsk_opacity_node_new (child, i / 4.0);
graphene_matrix_init_translate (&matrix, &(const graphene_point3d_t) { i* 210, 0, 0 });
nodes[i] = gsk_transform_node_new (node, &matrix);
gsk_render_node_unref (node);
}
gsk_render_node_unref (child);
container = gsk_container_node_new (nodes, 5);
for (i = 0; i < 5; i++)
gsk_render_node_unref (nodes[i]);
return container;
}
static const struct {
const char *name;
GskRenderNode * (* func) (void);
@@ -423,6 +453,7 @@ static const struct {
{ "blendmodes.node", blendmodes },
{ "cross-fades.node", cross_fades },
{ "transform.node", transform },
{ "opacity.node", opacity },
};
/*** test setup ***/