cogl: Pass a Context param to winsys_has_feature

Avoids using the global variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
This commit is contained in:
Bilal Elmoussaoui
2024-06-29 15:07:44 +02:00
committed by Marge Bot
parent 3fd7cdba09
commit 194fa80cdd
12 changed files with 29 additions and 124 deletions

View File

@ -472,6 +472,7 @@ should_use_clipped_redraw (gboolean is_full_redraw,
gboolean can_blit_sub_buffer;
gboolean can_use_clipped_redraw;
gboolean is_warmed_up;
CoglContext *context = cogl_framebuffer_get_context (framebuffer);
if (is_full_redraw)
return FALSE;
@ -490,7 +491,7 @@ should_use_clipped_redraw (gboolean is_full_redraw,
}
can_blit_sub_buffer =
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
cogl_context_has_winsys_feature (context, COGL_WINSYS_FEATURE_SWAP_REGION);
can_use_clipped_redraw =
_clutter_stage_window_can_clip_redraws (stage_window) &&
(can_blit_sub_buffer || has_buffer_age);
@ -509,6 +510,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_impl);
MetaStageView *view = META_STAGE_VIEW (stage_view);
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (stage_view);
CoglContext *context = cogl_framebuffer_get_context (fb);
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
MtkRectangle view_rect;
gboolean is_full_redraw;
@ -536,7 +538,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
has_buffer_age =
COGL_IS_ONSCREEN (onscreen) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
cogl_context_has_winsys_feature (context, COGL_WINSYS_FEATURE_BUFFER_AGE);
redraw_clip = clutter_stage_view_take_accumulated_redraw_clip (stage_view);