From 574ebafa46b9a6755907c2b20d176d15a49a240a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 2 Dec 2018 08:12:44 +0100 Subject: [PATCH] gl renderer: Reset offset when rendering offscreen We want to apply the offset to the rendered texture, not to the offscreen-rendered content. --- gsk/gl/gskglrenderer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 89be24fadc..0629bcd0e1 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -2324,6 +2324,8 @@ add_offscreen_ops (GskGLRenderer *self, const float scale = ops_get_scale (builder); const float width = (max_x - min_x) * scale; const float height = (max_y - min_y) * scale; + const float dx = builder->dx; + const float dy = builder->dy; int render_target; int prev_render_target; RenderOp op; @@ -2391,9 +2393,14 @@ add_offscreen_ops (GskGLRenderer *self, &GSK_ROUNDED_RECT_INIT (min_x * scale, min_y * scale, width, height)); + builder->dx = 0; + builder->dy = 0; gsk_gl_renderer_add_render_ops (self, child_node, builder); + builder->dx = dx; + builder->dy = dy; + if (reset_clip) ops_set_clip (builder, &prev_clip);