[mutter/gbsneto/window-screencast-fixes] window-actor: Inhibit culling when blitting to screencast



commit 1d080a72ac815d203bb50e8f9531df456929d0fb
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Mar 18 21:14:58 2020 -0300

    window-actor: Inhibit culling when blitting to screencast
    
    This allows us to screencast any window continuously, even
    without it being visible. Because it's still being painted,
    clients continue to receive frame callbacks, and people
    are happy again.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129

 src/compositor/meta-window-actor.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 143c5ac6b..a4b36da5e 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1287,6 +1287,8 @@ meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
   if (!clutter_actor_get_resource_scale (actor, &resource_scale))
     return FALSE;
 
+  clutter_actor_inhibit_culling (actor);
+
   width = ceilf (width * resource_scale);
   height = ceilf (height * resource_scale);
 
@@ -1322,6 +1324,8 @@ meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
   cogl_framebuffer_pop_matrix (framebuffer);
   cogl_framebuffer_pop_clip (framebuffer);
 
+  clutter_actor_uninhibit_culling (actor);
+
   return TRUE;
 }
 
@@ -1469,7 +1473,11 @@ meta_window_actor_get_image (MetaWindowActor *self,
   cogl_framebuffer_translate (framebuffer, -x, -y, 0);
 
   paint_context = clutter_paint_context_new_for_framebuffer (framebuffer);
+
+  clutter_actor_inhibit_culling (actor);
   clutter_actor_paint (actor, paint_context);
+  clutter_actor_uninhibit_culling (actor);
+
   clutter_paint_context_destroy (paint_context);
 
   if (clip)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]