gsk: Better handling of offscreens
authorMatthias Clasen <mclasen@redhat.com>
Fri, 5 May 2023 15:35:35 +0000 (11:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 5 May 2023 15:37:23 +0000 (11:37 -0400)
Take the scale into account for sizing the
offscreens for masks, blends and cross-fades.

gsk/gl/gskglrenderjob.c

index dc1be07d989c5aa28f962daba78f4cf24a422878..25943c3fe13cbe8ce22079e6210bd007282da7bf 100644 (file)
@@ -2824,7 +2824,7 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob      *job,
   offscreen_end.reset_clip = TRUE;
   offscreen_end.bounds = &node->bounds;
 
-  gsk_gl_render_job_set_modelview (job, NULL);
+  gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
 
   if (!gsk_gl_render_job_visit_node_with_offscreen (job, start_node, &offscreen_start))
     {
@@ -3243,7 +3243,7 @@ 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);
+  gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
 
   /* 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. */
@@ -3312,7 +3312,7 @@ 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);
+  gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
 
   /* TODO: We create 2 textures here as big as the mask node, but both
    * nodes might be a lot smaller than that.