summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-30 20:27:38 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-01 13:45:20 -0400
commit552df197c4dcb9773f59f6103c22d2debb3ddd92 (patch)
tree24803019b83f2a83315648bc30faad9186ee89b3
parentf6e47b7eb011ddc8869998fb6caee32a5a57eccd (diff)
downloadgtk+-552df197c4dcb9773f59f6103c22d2debb3ddd92.tar.gz
gsk: Fix blend transform handling
We must reset the modelview transform when rendering offscreen, or else we end up applying it twice.
-rw-r--r--gsk/gl/gskglrenderjob.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c
index fcd140501f..061265780f 100644
--- a/gsk/gl/gskglrenderjob.c
+++ b/gsk/gl/gskglrenderjob.c
@@ -3322,10 +3322,14 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
bottom_offscreen.force_offscreen = TRUE;
bottom_offscreen.reset_clip = TRUE;
+ gsk_gl_render_job_set_modelview (job, NULL);
+
/* TODO: We create 2 textures here as big as the blend node, but both the
* start and the end node might be a lot smaller than that. */
if (!gsk_gl_render_job_visit_node_with_offscreen (job, bottom_child, &bottom_offscreen))
{
+ gsk_gl_render_job_pop_modelview (job);
+
gsk_gl_render_job_visit_node (job, top_child);
return;
}
@@ -3334,6 +3338,8 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
if (!gsk_gl_render_job_visit_node_with_offscreen (job, top_child, &top_offscreen))
{
+ gsk_gl_render_job_pop_modelview (job);
+
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
@@ -3347,6 +3353,8 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
g_assert (top_offscreen.was_offscreen);
+ gsk_gl_render_job_pop_modelview (job);
+
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blend));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,