[mutter] screen-cast-window: Add API to check if content has damage



commit 2f01418d455b5c1880f9cb3dc25d6e5bd5270b05
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Jan 23 19:10:58 2019 +0100

    screen-cast-window: Add API to check if content has damage
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/413

 src/backends/meta-screen-cast-window.c | 9 +++++++++
 src/backends/meta-screen-cast-window.h | 4 ++++
 src/compositor/meta-window-actor.c     | 7 +++++++
 3 files changed, 20 insertions(+)
---
diff --git a/src/backends/meta-screen-cast-window.c b/src/backends/meta-screen-cast-window.c
index 5df8a3416..ce2bf82c9 100644
--- a/src/backends/meta-screen-cast-window.c
+++ b/src/backends/meta-screen-cast-window.c
@@ -77,3 +77,12 @@ meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
                                                                         bounds,
                                                                         data);
 }
+
+gboolean
+meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window)
+{
+  MetaScreenCastWindowInterface *iface =
+    META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window);
+
+  return iface->has_damage (screen_cast_window);
+}
diff --git a/src/backends/meta-screen-cast-window.h b/src/backends/meta-screen-cast-window.h
index 447fade7b..badd88224 100644
--- a/src/backends/meta-screen-cast-window.h
+++ b/src/backends/meta-screen-cast-window.h
@@ -55,6 +55,8 @@ struct _MetaScreenCastWindowInterface
   void (*capture_into) (MetaScreenCastWindow *screen_cast_window,
                         MetaRectangle        *bounds,
                         uint8_t              *data);
+
+  gboolean (*has_damage) (MetaScreenCastWindow *screen_cast_window);
 };
 
 void meta_screen_cast_window_get_frame_bounds (MetaScreenCastWindow *screen_cast_window,
@@ -76,6 +78,8 @@ void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_win
                                            MetaRectangle        *bounds,
                                            uint8_t              *data);
 
+gboolean meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window);
+
 G_END_DECLS
 
 #endif /* META_SCREEN_CAST_WINDOW_H */
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 616739223..adcba898c 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -2007,6 +2007,12 @@ meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window,
   cairo_surface_destroy (image);
 }
 
+static gboolean
+meta_window_actor_has_damage (MetaScreenCastWindow *screen_cast_window)
+{
+  return clutter_actor_has_damage (CLUTTER_ACTOR (screen_cast_window));
+}
+
 static void
 screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
 {
@@ -2014,4 +2020,5 @@ screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
   iface->transform_relative_position = meta_window_actor_transform_relative_position;
   iface->transform_cursor_position = meta_window_actor_transform_cursor_position;
   iface->capture_into = meta_window_actor_capture_into;
+  iface->has_damage = meta_window_actor_has_damage;
 }


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