Adapt to required CoglContext params

They used to retrieve it from a global variable which we are trying to
remove upstream
This commit is contained in:
Bilal Elmoussaoui 2024-06-29 19:08:32 +02:00
parent 99a36210b6
commit 78e223ace0

View file

@ -908,10 +908,11 @@ global_stage_before_paint (gpointer data)
} }
static gboolean static gboolean
load_gl_symbol (const char *name, load_gl_symbol (CoglContext *ctx,
const char *name,
void **func) void **func)
{ {
*func = cogl_get_proc_address (name); *func = cogl_get_proc_address (ctx, name);
if (!*func) if (!*func)
{ {
g_warning ("failed to resolve required GL symbol \"%s\"\n", name); g_warning ("failed to resolve required GL symbol \"%s\"\n", name);
@ -928,6 +929,7 @@ global_stage_after_paint (ClutterStage *stage,
{ {
/* At this point, we've finished all layout and painting, but haven't /* At this point, we've finished all layout and painting, but haven't
* actually flushed or swapped */ * actually flushed or swapped */
CoglContext *cogl_context = GNOME_SHELL_PLUGIN (global->plugin)->cogl_context;
if (global->frame_timestamps && global->frame_finish_timestamp) if (global->frame_timestamps && global->frame_finish_timestamp)
{ {
@ -946,9 +948,9 @@ global_stage_after_paint (ClutterStage *stage,
static void (*finish) (void); static void (*finish) (void);
if (!finish) if (!finish)
load_gl_symbol ("glFinish", (void **)&finish); load_gl_symbol (cogl_context, "glFinish", (void **)&finish);
cogl_flush (); cogl_flush (cogl_context);
finish (); finish ();
shell_perf_log_event (shell_perf_log_get_default (), shell_perf_log_event (shell_perf_log_get_default (),