From b17246458ab21d55d8edfc5b2e5f6d4a85fe844a Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 3 Nov 2023 18:03:08 +0100 Subject: [PATCH] clutter/paint-context: Stop copying NULL-regions Unlike `cairo_region_copy`, `mtk_region_copy()` does not accept NULL pointers. Fixes: 655b4a9c75 (Port to MtkRegion) Part-of: --- clutter/clutter/clutter-paint-context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-paint-context.c b/clutter/clutter/clutter-paint-context.c index 096c4d10b..3bae493a6 100644 --- a/clutter/clutter/clutter-paint-context.c +++ b/clutter/clutter/clutter-paint-context.c @@ -73,9 +73,11 @@ clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer, paint_context = g_new0 (ClutterPaintContext, 1); g_ref_count_init (&paint_context->ref_count); - paint_context->redraw_clip = mtk_region_copy (redraw_clip); paint_context->paint_flags = paint_flags; + if (redraw_clip) + paint_context->redraw_clip = mtk_region_copy (redraw_clip); + clutter_paint_context_push_framebuffer (paint_context, framebuffer); return paint_context;