summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-10-20 09:31:14 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-10-20 13:54:01 +0200
commitb76c5abb573f1fffd69ffdc0dc637a7ebdf8df78 (patch)
tree234c024307a3cff0d63c7a1314efb7d59156853e /gsk
parent04f6b262051a1c8ea6afdc7b88412184bf6f32b8 (diff)
downloadgtk+-b76c5abb573f1fffd69ffdc0dc637a7ebdf8df78.tar.gz
Tweak transform node apis
Rename the getter to follow the peek naming scheme. Update all callers.
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gskglrenderer.c2
-rw-r--r--gsk/gskrendernode.h4
-rw-r--r--gsk/gskrendernodeimpl.c9
-rw-r--r--gsk/gskvulkanrenderpass.c9
4 files changed, 11 insertions, 13 deletions
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index 768467f4c1..ee9ac46ecc 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -907,7 +907,7 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
{
graphene_matrix_t transform, transformed_mv;
- gsk_transform_node_get_transform (node, &transform);
+ graphene_matrix_init_from_matrix (&transform, gsk_transform_node_peek_transform (node));
graphene_matrix_multiply (&transform, modelview, &transformed_mv);
gsk_gl_renderer_add_render_item (self,
projection, &transformed_mv,
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index cec3728728..2d70939f38 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -203,8 +203,8 @@ GskRenderNode * gsk_transform_node_new (GskRenderNode
GDK_AVAILABLE_IN_3_90
GskRenderNode * gsk_transform_node_get_child (GskRenderNode *node);
GDK_AVAILABLE_IN_3_94
-void gsk_transform_node_get_transform (GskRenderNode *node,
- graphene_matrix_t *transform);
+const graphene_matrix_t *
+ gsk_transform_node_peek_transform (GskRenderNode *node);
GDK_AVAILABLE_IN_3_90
GskRenderNode * gsk_opacity_node_new (GskRenderNode *child,
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index e35c1cdf5b..157835f450 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -2326,15 +2326,14 @@ gsk_transform_node_get_child (GskRenderNode *node)
return self->child;
}
-void
-gsk_transform_node_get_transform (GskRenderNode *node,
- graphene_matrix_t *transform)
+const graphene_matrix_t *
+gsk_transform_node_peek_transform (GskRenderNode *node)
{
GskTransformNode *self = (GskTransformNode *) node;
- g_return_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TRANSFORM_NODE));
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TRANSFORM_NODE), NULL);
- graphene_matrix_init_from_matrix (transform, &self->transform);
+ return &self->transform;
}
/*** GSK_OPACITY_NODE ***/
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 40d2717c08..6b83e8ad44 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -555,8 +555,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
case GSK_TRANSFORM_NODE:
{
- graphene_matrix_t transform;
- graphene_matrix_t mv;
+ graphene_matrix_t transform, mv;
GskRenderNode *child;
#if 0
@@ -564,8 +563,8 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
FALLBACK ("Transform nodes can't deal with clip type %u\n", clip->type);
#endif
- gsk_transform_node_get_transform (node, &transform);
- mv = self->mv;
+ graphene_matrix_init_from_matrix (&transform, gsk_transform_node_peek_transform (node));
+ graphene_matrix_init_from_matrix (&mv, &self->mv);
graphene_matrix_multiply (&transform, &mv, &self->mv);
child = gsk_transform_node_get_child (node);
if (!gsk_vulkan_push_constants_transform (&op.constants.constants, constants, &transform, &child->bounds))
@@ -575,7 +574,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
gsk_vulkan_render_pass_add_node (self, render, &op.constants.constants, child);
gsk_vulkan_push_constants_init_copy (&op.constants.constants, constants);
- self->mv = mv;
+ graphene_matrix_init_from_matrix (&self->mv, &mv);
g_array_append_val (self->render_ops, op);
}
return;