summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-01-19 15:00:22 +0100
committerTimm Bäder <mail@baedert.org>2018-01-19 15:00:22 +0100
commit8f4e0705dc0f9dca0d3db019c2eac4089aba022e (patch)
treed31c8ba887bb3fa838cf0deead98580332846b04
parent87bdfbb02c659da418641a67bc4e4a1dcbbf63e4 (diff)
downloadgtk+-8f4e0705dc0f9dca0d3db019c2eac4089aba022e.tar.gz
gl renderer: Fix shadow node child offset
We shouldn't apply the shadow offset when drawing the child offscreen, instead apply it afterwards when we draw it to the current render target.
-rw-r--r--gsk/gl/gskglrenderer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 71ba645aeb..84e74d72de 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1327,21 +1327,20 @@ render_shadow_node (GskGLRenderer *self,
prev_dx = builder->dx;
prev_dy = builder->dy;
- ops_offset (builder, dx, dy);
-
if (gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE)
{
+ ops_offset (builder, dx, dy);
render_text_node (self, shadow_child, builder, &shadow->color, TRUE);
ops_offset (builder, prev_dx, prev_dy);
continue;
}
+ /* Draw the child offscreen, without the offset. */
add_offscreen_ops (self, builder,
- dx + min_x, dx + max_x, dy + min_y, dy + max_y,
+ min_x, max_x, min_y, max_y,
shadow_child, &texture_id, &is_offscreen, FALSE);
- ops_offset (builder, prev_dx, prev_dy);
-
+ ops_offset (builder, dx, dy);
ops_set_program (builder, &self->shadow_program);
ops_set_color (builder, &shadow->color);
ops_set_texture (builder, texture_id);
@@ -1373,6 +1372,8 @@ render_shadow_node (GskGLRenderer *self,
ops_draw (builder, vertex_data);
}
+
+ ops_offset (builder, prev_dx, prev_dy);
}
/* Now draw the child normally */