clutter/stage: Assign frames to paint context

When rendering through the 'paint-view' handler, assign the frame
to the paint context. Otherwise, when rendering outside of the
frame clock schedule, don't.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
This commit is contained in:
Georges Basile Stavracas Neto 2023-01-24 11:53:14 -03:00 committed by Robert Mader
parent 82b037e74c
commit 81c9c43d26

View File

@ -406,6 +406,7 @@ setup_clip_frustum (ClutterStage *stage,
static void static void
clutter_stage_do_paint_view (ClutterStage *stage, clutter_stage_do_paint_view (ClutterStage *stage,
ClutterStageView *view, ClutterStageView *view,
ClutterFrame *frame,
const cairo_region_t *redraw_clip) const cairo_region_t *redraw_clip)
{ {
ClutterPaintContext *paint_context; ClutterPaintContext *paint_context;
@ -451,6 +452,9 @@ clutter_stage_do_paint_view (ClutterStage *stage,
clip_frusta, clip_frusta,
CLUTTER_PAINT_FLAG_NONE); CLUTTER_PAINT_FLAG_NONE);
if (frame)
clutter_paint_context_assign_frame (paint_context, frame);
clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context); clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context);
clutter_paint_context_destroy (paint_context); clutter_paint_context_destroy (paint_context);
} }
@ -1259,7 +1263,7 @@ clutter_stage_real_paint_view (ClutterStage *stage,
const cairo_region_t *redraw_clip, const cairo_region_t *redraw_clip,
ClutterFrame *frame) ClutterFrame *frame)
{ {
clutter_stage_do_paint_view (stage, view, redraw_clip); clutter_stage_do_paint_view (stage, view, frame, redraw_clip);
} }
static void static void
@ -1918,7 +1922,7 @@ clutter_stage_read_pixels (ClutterStage *stage,
} }
framebuffer = clutter_stage_view_get_framebuffer (view); framebuffer = clutter_stage_view_get_framebuffer (view);
clutter_stage_do_paint_view (stage, view, clip); clutter_stage_do_paint_view (stage, view, NULL, clip);
cairo_region_destroy (clip); cairo_region_destroy (clip);