[gtk+] Tweak transform node apis
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Tweak transform node apis
- Date: Fri, 20 Oct 2017 12:44:35 +0000 (UTC)
commit b76c5abb573f1fffd69ffdc0dc637a7ebdf8df78
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 20 09:31:14 2017 +0200
Tweak transform node apis
Rename the getter to follow the peek naming scheme.
Update all callers.
gsk/gskglrenderer.c | 2 +-
gsk/gskrendernode.h | 4 ++--
gsk/gskrendernodeimpl.c | 9 ++++-----
gsk/gskvulkanrenderpass.c | 9 ++++-----
4 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index 768467f..ee9ac46 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 cec3728..2d70939 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 e35c1cd..157835f 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 40d2717..6b83e8a 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]