From e31c47877affab5e0895bfccbfdff8b62687c0ee Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 13 Feb 2024 13:57:55 +0100 Subject: [PATCH] frame: Inline get_mask where it is used The function was used only once so just move it content where it is called. It allows us to drop more cairo paths from the API surface even if it is not part of a public api Part-of: --- src/compositor/meta-window-actor-x11.c | 7 ++++++- src/core/frame.c | 17 ----------------- src/core/frame.h | 4 ---- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index 4f825fb39..a046d33c1 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -859,7 +859,12 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11, region_to_cairo_path (frame_paint_region, cr); cairo_clip (cr); - meta_frame_get_mask (window->frame, &frame_rect, cr); + cairo_rectangle (cr, + 0, 0, + window->frame->rect.width, + window->frame->rect.height); + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_fill (cr); cairo_surface_flush (image); scanned_region = scan_visible_region (mask_data, stride, frame_paint_region); diff --git a/src/core/frame.c b/src/core/frame.c index 941768570..914b144b8 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -413,23 +413,6 @@ meta_frame_get_frame_bounds (MetaFrame *frame) return bounds; } -void -meta_frame_get_mask (MetaFrame *frame, - MtkRectangle *frame_rect, - cairo_t *cr) -{ - MetaFrameBorders borders; - - meta_frame_calc_borders (frame, &borders); - - cairo_rectangle (cr, - 0, 0, - frame->rect.width, - frame->rect.height); - cairo_set_source_rgb (cr, 0, 0, 0); - cairo_fill (cr); -} - Window meta_frame_get_xwindow (MetaFrame *frame) { diff --git a/src/core/frame.h b/src/core/frame.h index 240e4edfa..de1ce909b 100644 --- a/src/core/frame.h +++ b/src/core/frame.h @@ -69,10 +69,6 @@ void meta_frame_clear_cached_borders (MetaFrame *frame); MtkRegion *meta_frame_get_frame_bounds (MetaFrame *frame); -void meta_frame_get_mask (MetaFrame *frame, - MtkRectangle *frame_rect, - cairo_t *cr); - gboolean meta_frame_handle_xevent (MetaFrame *frame, XEvent *event);