[gtk+/wip/ebassi/gsk-renderer: 121/126] gsk: Remove child-transform from render nodes
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer: 121/126] gsk: Remove child-transform from render nodes
- Date: Tue, 9 Aug 2016 16:40:55 +0000 (UTC)
commit e80800692edc0c51a76ef56472402208d4868805
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Aug 8 19:34:03 2016 +0100
gsk: Remove child-transform from render nodes
The child-transform is useful only if we also provide clipping to the
parent nodes, otherwise children will just be drawn outside of the
parent's bounds.
We'll introduce child transforms either at a higher layer, or once we
add clipping support to GskRenderNode.
docs/reference/gsk/gsk3-sections.txt | 1 -
gsk/gskrendernode.c | 36 ++-------------------------------
gsk/gskrendernode.h | 3 --
gsk/gskrendernodeprivate.h | 4 ---
4 files changed, 3 insertions(+), 41 deletions(-)
---
diff --git a/docs/reference/gsk/gsk3-sections.txt b/docs/reference/gsk/gsk3-sections.txt
index 36160da..c412444 100644
--- a/docs/reference/gsk/gsk3-sections.txt
+++ b/docs/reference/gsk/gsk3-sections.txt
@@ -55,7 +55,6 @@ gsk_render_node_contains
gsk_render_node_set_bounds
gsk_render_node_set_transform
gsk_render_node_set_anchor_point
-gsk_render_node_set_child_transform
gsk_render_node_set_opacity
gsk_render_node_set_hidden
gsk_render_node_is_hidden
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 716ecfa..1ec296e 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -177,7 +177,6 @@ gsk_render_node_init (GskRenderNode *self)
graphene_rect_init_from_rect (&self->bounds, graphene_rect_zero ());
graphene_matrix_init_identity (&self->transform);
- graphene_matrix_init_identity (&self->child_transform);
graphene_point3d_init (&self->anchor_point, 0.f, 0.f, 0.f);
@@ -962,31 +961,6 @@ gsk_render_node_set_anchor_point (GskRenderNode *node,
}
/**
- * gsk_render_node_set_child_transform:
- * @node: a #GskRenderNode
- * @transform: (nullable): a transformation matrix
- *
- * Sets the transformation matrix used when rendering the children
- * of @node.
- *
- * Since: 3.22
- */
-void
-gsk_render_node_set_child_transform (GskRenderNode *node,
- const graphene_matrix_t *transform)
-{
- g_return_if_fail (GSK_IS_RENDER_NODE (node));
- g_return_if_fail (node->is_mutable);
-
- if (transform == NULL)
- graphene_matrix_init_identity (&node->child_transform);
- else
- graphene_matrix_init_from_matrix (&node->child_transform, transform);
-
- node->child_transform_set = !graphene_matrix_is_identity (&node->child_transform);
-}
-
-/**
* gsk_render_node_set_opacity:
* @node: a #GskRenderNode
* @opacity: the opacity of the node, between 0 (fully transparent) and
@@ -1177,11 +1151,10 @@ gsk_render_node_update_world_matrix (GskRenderNode *node,
if (force || node->needs_world_matrix_update)
{
- GSK_NOTE (RENDER_NODE, g_print ("Updating cached world matrix on node %p [parent=%p, t_set=%s,
ct_set=%s]\n",
+ GSK_NOTE (RENDER_NODE, g_print ("Updating cached world matrix on node %p [parent=%p, t_set=%s]\n",
node,
node->parent != NULL ? node->parent : 0,
- node->transform_set ? "y" : "n",
- node->parent != NULL && node->parent->child_transform_set ? "y" :
"n"));
+ node->transform_set ? "y" : "n"));
if (node->parent == NULL)
{
@@ -1195,10 +1168,7 @@ gsk_render_node_update_world_matrix (GskRenderNode *node,
GskRenderNode *parent = node->parent;
graphene_matrix_t tmp;
- if (parent->child_transform_set)
- graphene_matrix_init_from_matrix (&tmp, &parent->child_transform);
- else
- graphene_matrix_init_identity (&tmp);
+ graphene_matrix_init_identity (&tmp);
if (node->transform_set)
graphene_matrix_multiply (&tmp, &node->transform, &tmp);
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index ced2630..afeab20 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -98,9 +98,6 @@ GDK_AVAILABLE_IN_3_22
void gsk_render_node_set_anchor_point (GskRenderNode *node,
const graphene_point3d_t *offset);
GDK_AVAILABLE_IN_3_22
-void gsk_render_node_set_child_transform (GskRenderNode *node,
- const graphene_matrix_t *transform);
-GDK_AVAILABLE_IN_3_22
void gsk_render_node_set_opacity (GskRenderNode *node,
double opacity);
GDK_AVAILABLE_IN_3_22
diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 0dce747..85cb2b8 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -55,15 +55,11 @@ struct _GskRenderNode
graphene_point3d_t anchor_point;
- /* Transformations applied to the children of the node */
- graphene_matrix_t child_transform;
-
/* Bit fields; leave at the end */
gboolean is_mutable : 1;
gboolean hidden : 1;
gboolean opaque : 1;
gboolean transform_set : 1;
- gboolean child_transform_set : 1;
gboolean needs_world_matrix_update : 1;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]