kms/update: Use mtk_region_get_box() instead of reconstructing the boxes

The underlying data structure of MtkRegion is pixman_region32, which
gives us boxes, not rectangles. Use the new get_box() API to bypass
going via rectangles to get the boxes directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4103>
This commit is contained in:
Jonas Ådahl 2024-10-25 21:48:36 +02:00 committed by Marge Bot
parent 9e3fd379d3
commit 59f40fe16c

View File

@ -635,12 +635,11 @@ meta_kms_plane_assignment_set_fb_damage (MetaKmsPlaneAssignment *plane_assignmen
mode_rects = g_new0 (struct drm_mode_rect, n_rectangles); mode_rects = g_new0 (struct drm_mode_rect, n_rectangles);
for (i = 0; i < n_rectangles; ++i) for (i = 0; i < n_rectangles; ++i)
{ {
MtkRectangle rectangle = mtk_region_get_rectangle (region, i); mtk_region_get_box (region, i,
&mode_rects[i].x1,
mode_rects[i].x1 = rectangle.x; &mode_rects[i].y1,
mode_rects[i].y1 = rectangle.y; &mode_rects[i].x2,
mode_rects[i].x2 = rectangle.x + rectangle.width; &mode_rects[i].y2);
mode_rects[i].y2 = rectangle.y + rectangle.height;
} }
fb_damage = g_new0 (MetaKmsFbDamage, 1); fb_damage = g_new0 (MetaKmsFbDamage, 1);