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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
This commit is contained in:
Jonas Ådahl 2019-01-23 19:10:58 +01:00
parent a76107a19f
commit 2f01418d45
3 changed files with 20 additions and 0 deletions

View File

@ -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);
}

View File

@ -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 */

View File

@ -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;
}