[gtk] gl renderer: transform nodes: offset
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: transform nodes: offset
- Date: Tue, 4 Dec 2018 05:31:51 +0000 (UTC)
commit d67dacedba00815d773415e7c6f68673c022c941
Author: Timm Bäder <mail baedert org>
Date: Mon Dec 3 18:29:36 2018 +0100
gl renderer: transform nodes: offset
gsk/gl/gskglrenderer.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index f9fba2d12d..14d8d82f9b 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -816,19 +816,30 @@ render_transform_node (GskGLRenderer *self,
graphene_matrix_init_from_matrix (&transform, gsk_transform_node_peek_transform (node));
graphene_matrix_multiply (&transform, builder->current_modelview, &transformed_mv);
+ graphene_matrix_translate (&transformed_mv, &(graphene_point3d_t) { builder->dx, builder->dy, 0});
+
+ /* We just added the offset to the new modelview matrix, so the following
+ * cases dont' have to care about builder->dx/dy! */
ops_push_modelview (builder, &transformed_mv);
if (ops_modelview_is_simple (builder) ||
node_supports_transform (child))
{
+ const float dx = builder->dx;
+ const float dy = builder->dy;
+
+ builder->dx = 0;
+ builder->dy = 0;
gsk_gl_renderer_add_render_ops (self, child, builder);
+ builder->dx = dx;
+ builder->dy = dy;
}
else
{
- const float min_x = builder->dx + child->bounds.origin.x;
- const float min_y = builder->dy + child->bounds.origin.y;
- const float max_x = min_x + child->bounds.size.width;
- const float max_y = min_y + child->bounds.size.height;
+ const float min_x = node->bounds.origin.x;
+ const float min_y = node->bounds.origin.y;
+ const float max_x = min_x + node->bounds.size.width;
+ const float max_y = min_y + node->bounds.size.height;
const GskQuadVertex vertex_data[GL_N_VERTICES] = {
{ { min_x, min_y }, { 0, 1 }, },
{ { min_x, max_y }, { 0, 0 }, },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]