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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3361>
This commit is contained in:
Robert Mader 2023-11-03 18:03:08 +01:00
parent 4e088cac0e
commit b17246458a

View File

@ -73,9 +73,11 @@ clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer,
paint_context = g_new0 (ClutterPaintContext, 1); paint_context = g_new0 (ClutterPaintContext, 1);
g_ref_count_init (&paint_context->ref_count); g_ref_count_init (&paint_context->ref_count);
paint_context->redraw_clip = mtk_region_copy (redraw_clip);
paint_context->paint_flags = paint_flags; 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); clutter_paint_context_push_framebuffer (paint_context, framebuffer);
return paint_context; return paint_context;