summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-30 20:40:00 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-01 13:45:20 -0400
commitf56328a6cc3cb1f2fb8a2692eedc6dd0db4f44c8 (patch)
tree9e5b45999f82dc1e78916bbca6235a75473b00ef
parentf29b24517e3cad5b76b945eae179b5b729ef734f (diff)
downloadgtk+-f56328a6cc3cb1f2fb8a2692eedc6dd0db4f44c8.tar.gz
gsk: Fix mask transform handling
We must reset the modelview transform when offscreen, or else we end up applying it twice.
-rw-r--r--gsk/gl/gskglrenderjob.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c
index 061265780f..df19d98209 100644
--- a/gsk/gl/gskglrenderjob.c
+++ b/gsk/gl/gskglrenderjob.c
@@ -3391,11 +3391,14 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
mask_offscreen.reset_clip = TRUE;
mask_offscreen.do_not_cache = TRUE;
+ gsk_gl_render_job_set_modelview (job, NULL);
+
/* TODO: We create 2 textures here as big as the mask node, but both
* nodes might be a lot smaller than that.
*/
if (!gsk_gl_render_job_visit_node_with_offscreen (job, source, &source_offscreen))
{
+ gsk_gl_render_job_pop_modelview (job);
gsk_gl_render_job_visit_node (job, source);
return;
}
@@ -3404,11 +3407,14 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
if (!gsk_gl_render_job_visit_node_with_offscreen (job, mask, &mask_offscreen))
{
+ gsk_gl_render_job_pop_modelview (job);
return;
}
g_assert (mask_offscreen.was_offscreen);
+ gsk_gl_render_job_pop_modelview (job);
+
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, mask));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,