summaryrefslogtreecommitdiff
path: root/gsk/gskglrenderer.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-12 16:52:55 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-20 18:01:09 +0100
commita8f2b3e75e9d44864f5bb509e4a7acd4a59b1fc1 (patch)
tree022a9e2cf6cf484d1913b997341eece5c482888a /gsk/gskglrenderer.c
parent3eb7c4719b57a37888a7166fe4eae5fe1c081b72 (diff)
downloadgtk+-a8f2b3e75e9d44864f5bb509e4a7acd4a59b1fc1.tar.gz
gsk: Remove world matrix support
Use the real transform and compute it manually.
Diffstat (limited to 'gsk/gskglrenderer.c')
-rw-r--r--gsk/gskglrenderer.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index f7d9eb9d9c..654e5d1457 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -617,12 +617,13 @@ render_node_needs_render_target (GskRenderNode *node)
static void
gsk_gl_renderer_add_render_item (GskGLRenderer *self,
const graphene_matrix_t *projection,
+ const graphene_matrix_t *parent_modelview,
GArray *render_items,
GskRenderNode *node,
RenderItem *parent)
{
graphene_rect_t viewport;
- graphene_matrix_t mv;
+ graphene_matrix_t mv, transform;
graphene_rect_t bounds;
GskRenderNode *child;
RenderItem item;
@@ -659,7 +660,8 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
item.max.z = 0.f;
/* The location of the item, in normalized world coordinates */
- gsk_render_node_get_world_matrix (node, &mv);
+ gsk_render_node_get_transform (node, &transform);
+ graphene_matrix_multiply (&transform, parent_modelview, &mv);
graphene_matrix_multiply (&mv, &self->mvp, &item.mvp);
item.z = project_item (projection, &mv);
@@ -791,7 +793,7 @@ out:
child != NULL;
child = gsk_render_node_get_next_sibling (child))
{
- gsk_gl_renderer_add_render_item (self, projection, render_items, child, ritem);
+ gsk_gl_renderer_add_render_item (self, projection, &mv, render_items, child, ritem);
}
}
@@ -800,12 +802,16 @@ gsk_gl_renderer_validate_tree (GskGLRenderer *self,
GskRenderNode *root,
const graphene_matrix_t *projection)
{
+ graphene_matrix_t identity;
+
if (self->gl_context == NULL)
{
GSK_NOTE (OPENGL, g_print ("No valid GL context associated to the renderer"));
return FALSE;
}
+ graphene_matrix_init_identity (&identity);
+
gdk_gl_context_make_current (self->gl_context);
self->render_items = g_array_new (FALSE, FALSE, sizeof (RenderItem));
@@ -813,7 +819,7 @@ gsk_gl_renderer_validate_tree (GskGLRenderer *self,
gsk_gl_driver_begin_frame (self->gl_driver);
GSK_NOTE (OPENGL, g_print ("RenderNode -> RenderItem\n"));
- gsk_gl_renderer_add_render_item (self, projection, self->render_items, root, NULL);
+ gsk_gl_renderer_add_render_item (self, projection, &identity, self->render_items, root, NULL);
GSK_NOTE (OPENGL, g_print ("Total render items: %d\n",
self->render_items->len));