clutter: Pass 'ClutterFrame' in all stage update signals

That means before-update, prepare-paint, before-paint, paint-view, after-paint,
after-update. While yet to be used, it will be used as a transient frame
book keeping object, to maintain object and state that is only valid
during a frame dispatch.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2795>
This commit is contained in:
Jonas Ådahl
2022-10-13 17:50:34 +02:00
parent 24f44aa33e
commit 08b0e563d4
30 changed files with 126 additions and 64 deletions

View File

@ -165,6 +165,7 @@ meta_cursor_renderer_update_stage_overlay (MetaCursorRenderer *renderer,
static void
meta_cursor_renderer_after_paint (ClutterStage *stage,
ClutterStageView *stage_view,
ClutterFrame *frame,
MetaCursorRenderer *renderer)
{
MetaCursorRendererPrivate *priv =

View File

@ -191,6 +191,7 @@ cursor_changed (MetaCursorTracker *cursor_tracker,
static void
on_prepare_frame (ClutterStage *stage,
ClutterStageView *stage_view,
ClutterFrame *frame,
MetaScreenCastAreaStreamSrc *area_src)
{
sync_cursor_state (area_src);

View File

@ -287,6 +287,7 @@ cursor_changed (MetaCursorTracker *cursor_tracker,
static void
on_prepare_frame (ClutterStage *stage,
ClutterStageView *stage_view,
ClutterFrame *frame,
MetaScreenCastMonitorStreamSrc *monitor_src)
{
sync_cursor_state (monitor_src);

View File

@ -146,6 +146,7 @@ cursor_changed (MetaCursorTracker *cursor_tracker,
static void
on_prepare_frame (ClutterStage *stage,
ClutterStageView *stage_view,
ClutterFrame *frame,
MetaScreenCastVirtualStreamSrc *virtual_src)
{
sync_cursor_state (virtual_src);

View File

@ -396,12 +396,13 @@ scale_offset_and_clamp_region (const cairo_region_t *region,
static void
paint_stage (MetaStageImpl *stage_impl,
ClutterStageView *stage_view,
cairo_region_t *redraw_clip)
cairo_region_t *redraw_clip,
ClutterFrame *frame)
{
ClutterStage *stage = stage_impl->wrapper;
_clutter_stage_maybe_setup_viewport (stage, stage_view);
clutter_stage_paint_view (stage, stage_view, redraw_clip);
clutter_stage_paint_view (stage, stage_view, redraw_clip, frame);
clutter_stage_view_after_paint (stage_view, redraw_clip);
}
@ -607,7 +608,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
cairo_region_t *debug_redraw_clip;
debug_redraw_clip = cairo_region_create_rectangle (&view_rect);
paint_stage (stage_impl, stage_view, debug_redraw_clip);
paint_stage (stage_impl, stage_view, debug_redraw_clip, frame);
cairo_region_destroy (debug_redraw_clip);
}
else if (use_clipped_redraw)
@ -616,7 +617,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
paint_stage (stage_impl, stage_view, redraw_clip);
paint_stage (stage_impl, stage_view, redraw_clip, frame);
cogl_framebuffer_pop_clip (fb);
}
@ -624,7 +625,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
{
meta_topic (META_DEBUG_BACKEND, "Unclipped stage paint");
paint_stage (stage_impl, stage_view, redraw_clip);
paint_stage (stage_impl, stage_view, redraw_clip, frame);
}
g_clear_pointer (&redraw_clip, cairo_region_destroy);

View File

@ -209,7 +209,8 @@ notify_watchers_for_mode (MetaStage *stage,
static void
meta_stage_before_paint (ClutterStage *stage,
ClutterStageView *view)
ClutterStageView *view,
ClutterFrame *frame)
{
MetaStage *meta_stage = META_STAGE (stage);
@ -267,12 +268,14 @@ meta_stage_paint (ClutterActor *actor,
static void
meta_stage_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip)
const cairo_region_t *redraw_clip,
ClutterFrame *frame)
{
MetaStage *meta_stage = META_STAGE (stage);
CLUTTER_STAGE_CLASS (meta_stage_parent_class)->paint_view (stage, view,
redraw_clip);
redraw_clip,
frame);
notify_watchers_for_mode (meta_stage, view, NULL,
META_STAGE_WATCH_AFTER_PAINT);