clutter/stage-view: Allow stage view to allocate frame

This will be used to allow the native backend to allocate a KMS update
that'll be used for one frame.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2855>
This commit is contained in:
Jonas Ådahl 2022-07-07 09:23:41 +02:00 committed by Robert Mader
parent b80e84dea6
commit 678dc3243f
2 changed files with 16 additions and 0 deletions

View File

@ -1278,9 +1278,23 @@ handle_frame_clock_frame (ClutterFrameClock *frame_clock,
return clutter_frame_get_result (frame);
}
static ClutterFrame *
handle_frame_clock_new_frame (ClutterFrameClock *frame_clock,
gpointer user_data)
{
ClutterStageView *view = CLUTTER_STAGE_VIEW (user_data);
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
if (view_class->new_frame)
return view_class->new_frame (view);
else
return NULL;
}
static const ClutterFrameListenerIface frame_clock_listener_iface = {
.before_frame = handle_frame_clock_before_frame,
.frame = handle_frame_clock_frame,
.new_frame = handle_frame_clock_new_frame,
};
void

View File

@ -50,6 +50,8 @@ struct _ClutterStageViewClass
int dst_width,
int dst_height,
cairo_rectangle_int_t *dst_rect);
ClutterFrame * (* new_frame) (ClutterStageView *view);
};
CLUTTER_EXPORT