mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
Add a transform node reftest
This commit is contained in:
parent
4db1a7541a
commit
49ab093f26
@ -378,6 +378,39 @@ cross_fades (void)
|
||||
return container;
|
||||
}
|
||||
|
||||
static GskRenderNode *
|
||||
transform (void)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
GskRenderNode *nodes[10];
|
||||
GskRenderNode *container;
|
||||
graphene_matrix_t scale;
|
||||
graphene_matrix_t translate;
|
||||
graphene_matrix_t matrix;
|
||||
graphene_vec3_t axis;
|
||||
graphene_vec3_init (&axis, 0.0, 0.0, 1.0);
|
||||
int i;
|
||||
|
||||
node = ducky ();
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
graphene_matrix_init_rotate (&scale, 20.0 * i, &axis);
|
||||
graphene_matrix_init_translate (&translate, &(const graphene_point3d_t) { i* 110, 0, 0 });
|
||||
graphene_matrix_multiply (&scale, &translate, &matrix);
|
||||
nodes[i] = gsk_transform_node_new (node, &matrix);
|
||||
}
|
||||
|
||||
container = gsk_container_node_new (nodes, 5);
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
gsk_render_node_unref (nodes[i]);
|
||||
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
GskRenderNode * (* func) (void);
|
||||
@ -389,6 +422,7 @@ static const struct {
|
||||
{ "cross-fade.node", cross_fade },
|
||||
{ "blendmodes.node", blendmodes },
|
||||
{ "cross-fades.node", cross_fades },
|
||||
{ "transform.node", transform },
|
||||
};
|
||||
|
||||
/*** test setup ***/
|
||||
|
BIN
testsuite/gsk/transform.node
Normal file
BIN
testsuite/gsk/transform.node
Normal file
Binary file not shown.
BIN
testsuite/gsk/transform.png
Normal file
BIN
testsuite/gsk/transform.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Loading…
Reference in New Issue
Block a user