From 9ee1a0fc342e1aaed130f985137d9c74bf7af2b4 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 29 Jun 2024 16:25:22 +0200 Subject: [PATCH] cogl: Expose Renderer.get_proc_address Allows to get rid of the cogl_get_proc_address Part-of: --- cogl/cogl/cogl-atlas-texture.c | 1 - cogl/cogl/cogl-blit.c | 1 - cogl/cogl/cogl-clip-stack.c | 1 - cogl/cogl/cogl-context.c | 1 - cogl/cogl/cogl-debug.c | 1 - cogl/cogl/cogl-feature-private.c | 4 +- cogl/cogl/cogl-framebuffer.c | 1 - cogl/cogl/cogl-journal.c | 1 - cogl/cogl/cogl-onscreen.c | 1 - cogl/cogl/cogl-pipeline.c | 1 - cogl/cogl/cogl-primitives.c | 1 - cogl/cogl/cogl-renderer-private.h | 4 -- cogl/cogl/cogl-renderer.c | 2 +- cogl/cogl/cogl-renderer.h | 20 +++++++ cogl/cogl/cogl-texture.c | 1 - cogl/cogl/cogl.c | 9 --- cogl/cogl/cogl.h | 1 - cogl/cogl/cogl1-context.h | 66 --------------------- cogl/cogl/driver/gl/gl/cogl-driver-gl.c | 12 ++-- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 8 +-- cogl/cogl/meson.build | 1 - src/compositor/meta-compositor-x11.c | 15 ++++- src/compositor/meta-sync-ring.c | 41 +++++++------ src/compositor/meta-sync-ring.h | 9 ++- 24 files changed, 73 insertions(+), 130 deletions(-) delete mode 100644 cogl/cogl/cogl1-context.h diff --git a/cogl/cogl/cogl-atlas-texture.c b/cogl/cogl/cogl-atlas-texture.c index 40ceae08f..2e0a13b27 100644 --- a/cogl/cogl/cogl-atlas-texture.c +++ b/cogl/cogl/cogl-atlas-texture.c @@ -44,7 +44,6 @@ #include "cogl/cogl-rectangle-map.h" #include "cogl/cogl-journal-private.h" #include "cogl/cogl-atlas.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-sub-texture.h" #include "cogl/driver/gl/cogl-texture-gl-private.h" diff --git a/cogl/cogl/cogl-blit.c b/cogl/cogl/cogl-blit.c index 0468b7f35..817358500 100644 --- a/cogl/cogl/cogl-blit.c +++ b/cogl/cogl/cogl-blit.c @@ -41,7 +41,6 @@ #include "cogl/cogl-texture-private.h" #include "cogl/cogl-texture-2d-private.h" #include "cogl/cogl-private.h" -#include "cogl/cogl1-context.h" static const CoglBlitMode *_cogl_blit_default_mode = NULL; diff --git a/cogl/cogl/cogl-clip-stack.c b/cogl/cogl/cogl-clip-stack.c index fac0d02ce..fc3af5a0d 100644 --- a/cogl/cogl/cogl-clip-stack.c +++ b/cogl/cogl/cogl-clip-stack.c @@ -44,7 +44,6 @@ #include "cogl/cogl-private.h" #include "cogl/cogl-attribute-private.h" #include "cogl/cogl-primitive-private.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-offscreen.h" #include "cogl/cogl-matrix-stack.h" #include "mtk/mtk.h" diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c index 04a8ae0a6..da27c6d9b 100644 --- a/cogl/cogl/cogl-context.c +++ b/cogl/cogl/cogl-context.c @@ -45,7 +45,6 @@ #include "cogl/cogl-framebuffer-private.h" #include "cogl/cogl-onscreen-private.h" #include "cogl/cogl-attribute-private.h" -#include "cogl/cogl1-context.h" #include "cogl/winsys/cogl-winsys-private.h" #include diff --git a/cogl/cogl/cogl-debug.c b/cogl/cogl/cogl-debug.c index 2cf0eeb3b..764a86176 100644 --- a/cogl/cogl/cogl-debug.c +++ b/cogl/cogl/cogl-debug.c @@ -35,7 +35,6 @@ #include "cogl/cogl-i18n-private.h" #include "cogl/cogl-private.h" #include "cogl/cogl-debug.h" -#include "cogl/cogl1-context.h" /* XXX: If you add a debug option, please also add an option * definition to cogl-debug-options.h. This will enable us - for diff --git a/cogl/cogl/cogl-feature-private.c b/cogl/cogl/cogl-feature-private.c index 1ef42b87d..1f986188e 100644 --- a/cogl/cogl/cogl-feature-private.c +++ b/cogl/cogl/cogl-feature-private.c @@ -143,8 +143,8 @@ _cogl_feature_check (CoglRenderer *renderer, full_function_name = g_strconcat (data->functions[func_num].name, suffix, NULL); - func = _cogl_renderer_get_proc_address (renderer, - full_function_name); + func = cogl_renderer_get_proc_address (renderer, + full_function_name); g_free (full_function_name); if (func == NULL) diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c index 1df320a30..780c2aab8 100644 --- a/cogl/cogl/cogl-framebuffer.c +++ b/cogl/cogl/cogl-framebuffer.c @@ -46,7 +46,6 @@ #include "cogl/cogl-pipeline-state-private.h" #include "cogl/cogl-primitive-private.h" #include "cogl/cogl-offscreen.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-private.h" #include "cogl/cogl-primitives-private.h" #include "cogl/cogl-trace.h" diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c index 4fbba6871..0e3ffa367 100644 --- a/cogl/cogl/cogl-journal.c +++ b/cogl/cogl/cogl-journal.c @@ -43,7 +43,6 @@ #include "cogl/cogl-point-in-poly-private.h" #include "cogl/cogl-trace.h" #include "cogl/cogl-private.h" -#include "cogl/cogl1-context.h" #include #include diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index 4780c45f1..93245267d 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -38,7 +38,6 @@ #include "cogl/cogl-framebuffer-private.h" #include "cogl/cogl-onscreen-template-private.h" #include "cogl/cogl-context-private.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-closure-list-private.h" #include "cogl/cogl-poll-private.h" diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c index e5b9764a0..0b47d46c3 100644 --- a/cogl/cogl/cogl-pipeline.c +++ b/cogl/cogl/cogl-pipeline.c @@ -46,7 +46,6 @@ #include "cogl/cogl-profile.h" #include "cogl/cogl-depth-state-private.h" #include "cogl/cogl-snippet-private.h" -#include "cogl/cogl1-context.h" #include #include diff --git a/cogl/cogl/cogl-primitives.c b/cogl/cogl/cogl-primitives.c index 6582c277c..214d03416 100644 --- a/cogl/cogl/cogl-primitives.c +++ b/cogl/cogl/cogl-primitives.c @@ -40,7 +40,6 @@ #include "cogl/cogl-private.h" #include "cogl/cogl-meta-texture.h" #include "cogl/cogl-framebuffer-private.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-primitives-private.h" #include diff --git a/cogl/cogl/cogl-renderer-private.h b/cogl/cogl/cogl-renderer-private.h index f1dbab2b9..1949f5943 100644 --- a/cogl/cogl/cogl-renderer-private.h +++ b/cogl/cogl/cogl-renderer-private.h @@ -89,7 +89,3 @@ void _cogl_renderer_remove_native_filter (CoglRenderer *renderer, CoglNativeFilterFunc func, void *data); - -void * -_cogl_renderer_get_proc_address (CoglRenderer *renderer, - const char *name); diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c index eae6f8890..b02610014 100644 --- a/cogl/cogl/cogl-renderer.c +++ b/cogl/cogl/cogl-renderer.c @@ -615,7 +615,7 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer) } void * -_cogl_renderer_get_proc_address (CoglRenderer *renderer, +cogl_renderer_get_proc_address (CoglRenderer *renderer, const char *name) { const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer); diff --git a/cogl/cogl/cogl-renderer.h b/cogl/cogl/cogl-renderer.h index 11557314a..657b73ec0 100644 --- a/cogl/cogl/cogl-renderer.h +++ b/cogl/cogl/cogl-renderer.h @@ -311,4 +311,24 @@ cogl_renderer_is_dma_buf_supported (CoglRenderer *renderer); COGL_EXPORT void cogl_renderer_bind_api (CoglRenderer *renderer); +/** + * cogl_renderer_get_proc_address: + * @renderer: A #CoglRenderer. + * @name: the name of the function. + * + * Gets a pointer to a given GL or GL ES extension function. This acts + * as a wrapper around glXGetProcAddress() or whatever is the + * appropriate function for the current backend. + * + * This function should not be used to query core opengl API + * symbols since eglGetProcAddress for example doesn't allow this and + * and may return a junk pointer if you do. + * + * Return value: a pointer to the requested function or %NULL if the + * function is not available. + */ +COGL_EXPORT void * +cogl_renderer_get_proc_address (CoglRenderer *renderer, + const char *name); + G_END_DECLS diff --git a/cogl/cogl/cogl-texture.c b/cogl/cogl/cogl-texture.c index 30f4c2d89..924960441 100644 --- a/cogl/cogl/cogl-texture.c +++ b/cogl/cogl/cogl-texture.c @@ -53,7 +53,6 @@ #include "cogl/cogl-context-private.h" #include "cogl/cogl-offscreen-private.h" #include "cogl/cogl-framebuffer-private.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-sub-texture.h" #include "cogl/cogl-primitive-texture.h" diff --git a/cogl/cogl/cogl.c b/cogl/cogl/cogl.c index 626dae976..e11ad9dc7 100644 --- a/cogl/cogl/cogl.c +++ b/cogl/cogl/cogl.c @@ -50,18 +50,9 @@ #include "cogl/cogl-framebuffer-private.h" #include "cogl/cogl-renderer-private.h" #include "cogl/cogl-private.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-offscreen.h" #include "cogl/winsys/cogl-winsys-private.h" -GCallback -cogl_get_proc_address (const char* name) -{ - _COGL_GET_CONTEXT (ctx, NULL); - - return _cogl_renderer_get_proc_address (ctx->display->renderer, name); -} - gboolean _cogl_check_extension (const char *name, char * const *ext) { diff --git a/cogl/cogl/cogl.h b/cogl/cogl/cogl.h index 983e0770a..17cdc8c62 100644 --- a/cogl/cogl/cogl.h +++ b/cogl/cogl/cogl.h @@ -45,7 +45,6 @@ #include "cogl/cogl-macros.h" -#include "cogl/cogl1-context.h" #include "cogl/cogl-bitmap.h" #include "cogl/cogl-color.h" #include "cogl/cogl-dma-buf-handle.h" diff --git a/cogl/cogl/cogl1-context.h b/cogl/cogl/cogl1-context.h deleted file mode 100644 index 6b7996f38..000000000 --- a/cogl/cogl/cogl1-context.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2010 Intel Corporation. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Authors: - * Robert Bragg - * - */ - -#pragma once - -#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION) -#error "Only can be included directly." -#endif - -#include "cogl/cogl-types.h" -#include "cogl/cogl-texture.h" -#include "cogl/cogl-framebuffer.h" -#include "cogl/cogl-macros.h" - -G_BEGIN_DECLS - -/* Misc */ -/** - * cogl_get_proc_address: (skip) - * @name: the name of the function. - * - * Gets a pointer to a given GL or GL ES extension function. This acts - * as a wrapper around glXGetProcAddress() or whatever is the - * appropriate function for the current backend. - * - * This function should not be used to query core opengl API - * symbols since eglGetProcAddress for example doesn't allow this and - * and may return a junk pointer if you do. - * - * Return value: a pointer to the requested function or %NULL if the - * function is not available. - */ -COGL_EXPORT GCallback -cogl_get_proc_address (const char *name); - - -G_END_DECLS diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 845b1550e..6bc944a17 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -429,14 +429,14 @@ _cogl_driver_update_features (CoglContext *ctx, functions because we need to use them to determine what functions we can expect */ ctx->glGetString = - (void *) _cogl_renderer_get_proc_address (ctx->display->renderer, - "glGetString"); + (void *) cogl_renderer_get_proc_address (ctx->display->renderer, + "glGetString"); ctx->glGetStringi = - (void *) _cogl_renderer_get_proc_address (ctx->display->renderer, - "glGetStringi"); + (void *) cogl_renderer_get_proc_address (ctx->display->renderer, + "glGetStringi"); ctx->glGetIntegerv = - (void *) _cogl_renderer_get_proc_address (ctx->display->renderer, - "glGetIntegerv"); + (void *) cogl_renderer_get_proc_address (ctx->display->renderer, + "glGetIntegerv"); gl_extensions = _cogl_context_get_gl_extensions (ctx); diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 1d9161bbf..853d1dde0 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -578,11 +578,11 @@ _cogl_driver_update_features (CoglContext *context, function because we need to use it to determine what functions we can expect */ context->glGetString = - (void *) _cogl_renderer_get_proc_address (context->display->renderer, - "glGetString"); + (void *) cogl_renderer_get_proc_address (context->display->renderer, + "glGetString"); context->glGetStringi = - (void *) _cogl_renderer_get_proc_address (context->display->renderer, - "glGetStringi"); + (void *) cogl_renderer_get_proc_address (context->display->renderer, + "glGetStringi"); gl_extensions = _cogl_context_get_gl_extensions (context); diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index 08431c7f1..d1dd5c00f 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -25,7 +25,6 @@ cogl_headers = [ 'cogl-attribute.h', 'cogl-bitmap.h', 'cogl-color.h', - 'cogl1-context.h', 'cogl-context.h', 'cogl-depth-state.h', 'cogl-display.h', diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c index cbc48bcef..657f9bdb6 100644 --- a/src/compositor/meta-compositor-x11.c +++ b/src/compositor/meta-compositor-x11.c @@ -133,6 +133,8 @@ meta_compositor_x11_manage (MetaCompositor *compositor, MetaDisplay *display = meta_compositor_get_display (compositor); MetaContext *context = meta_display_get_context (display); MetaBackend *backend = meta_context_get_backend (context); + ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); + CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend); MetaX11Display *x11_display = display->x11_display; Display *xdisplay = meta_x11_display_get_xdisplay (x11_display); int composite_version; @@ -186,7 +188,7 @@ meta_compositor_x11_manage (MetaCompositor *compositor, */ XMapWindow (xdisplay, compositor_x11->output); - compositor_x11->have_x11_sync_object = meta_sync_ring_init (xdisplay); + compositor_x11->have_x11_sync_object = meta_sync_ring_init (cogl_context, xdisplay); return TRUE; } @@ -332,6 +334,9 @@ maybe_do_sync (MetaCompositor *compositor) if (compositor_x11->frame_has_updated_xsurfaces) { MetaDisplay *display = meta_compositor_get_display (compositor); + MetaBackend *backend = meta_compositor_get_backend (compositor); + ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); + CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend); /* * We need to make sure that any X drawing that happens before the @@ -354,7 +359,7 @@ maybe_do_sync (MetaCompositor *compositor) * at this point is sufficient to flush the GLX buffers. */ if (compositor_x11->have_x11_sync_object) - compositor_x11->have_x11_sync_object = meta_sync_ring_insert_wait (); + compositor_x11->have_x11_sync_object = meta_sync_ring_insert_wait (cogl_context); else XSync (display->x11_display->xdisplay, False); } @@ -379,8 +384,12 @@ on_after_update (ClutterStage *stage, if (compositor_x11->frame_has_updated_xsurfaces) { + MetaBackend *backend = meta_compositor_get_backend (compositor); + ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); + CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend); + if (compositor_x11->have_x11_sync_object) - compositor_x11->have_x11_sync_object = meta_sync_ring_after_frame (); + compositor_x11->have_x11_sync_object = meta_sync_ring_after_frame (cogl_context); compositor_x11->frame_has_updated_xsurfaces = FALSE; } diff --git a/src/compositor/meta-sync-ring.c b/src/compositor/meta-sync-ring.c index 1267dd4f2..81584128d 100644 --- a/src/compositor/meta-sync-ring.c +++ b/src/compositor/meta-sync-ring.c @@ -132,10 +132,11 @@ meta_sync_ring_get (void) } static gboolean -load_gl_symbol (const char *name, +load_gl_symbol (CoglContext *ctx, + const char *name, void **func) { - *func = cogl_get_proc_address (name); + *func = cogl_renderer_get_proc_address (ctx->display->renderer, name); if (!*func) { meta_verbose ("MetaSyncRing: failed to resolve required GL symbol \"%s\"", name); @@ -187,7 +188,7 @@ check_gl_extensions (void) } static gboolean -load_required_symbols (void) +load_required_symbols (CoglContext *ctx) { static gboolean success = FALSE; @@ -199,11 +200,11 @@ load_required_symbols (void) * and dynamically loaded libGL at this point. */ - if (!load_gl_symbol ("glGetString", (void **) &meta_gl_get_string)) + if (!load_gl_symbol (ctx, "glGetString", (void **) &meta_gl_get_string)) goto out; - if (!load_gl_symbol ("glGetIntegerv", (void **) &meta_gl_get_integerv)) + if (!load_gl_symbol (ctx, "glGetIntegerv", (void **) &meta_gl_get_integerv)) goto out; - if (!load_gl_symbol ("glGetStringi", (void **) &meta_gl_get_stringi)) + if (!load_gl_symbol (ctx, "glGetStringi", (void **) &meta_gl_get_stringi)) goto out; if (!check_gl_extensions ()) @@ -212,15 +213,15 @@ load_required_symbols (void) goto out; } - if (!load_gl_symbol ("glDeleteSync", (void **) &meta_gl_delete_sync)) + if (!load_gl_symbol (ctx, "glDeleteSync", (void **) &meta_gl_delete_sync)) goto out; - if (!load_gl_symbol ("glClientWaitSync", (void **) &meta_gl_client_wait_sync)) + if (!load_gl_symbol (ctx, "glClientWaitSync", (void **) &meta_gl_client_wait_sync)) goto out; - if (!load_gl_symbol ("glWaitSync", (void **) &meta_gl_wait_sync)) + if (!load_gl_symbol (ctx, "glWaitSync", (void **) &meta_gl_wait_sync)) goto out; - if (!load_gl_symbol ("glImportSyncEXT", (void **) &meta_gl_import_sync)) + if (!load_gl_symbol (ctx, "glImportSyncEXT", (void **) &meta_gl_import_sync)) goto out; - if (!load_gl_symbol ("glFenceSync", (void **) &meta_gl_fence_sync)) + if (!load_gl_symbol (ctx, "glFenceSync", (void **) &meta_gl_fence_sync)) goto out; success = TRUE; @@ -405,7 +406,8 @@ meta_sync_free (MetaSync *self) } gboolean -meta_sync_ring_init (Display *xdisplay) +meta_sync_ring_init (CoglContext *ctx, + Display *xdisplay) { gint major, minor; guint i; @@ -417,7 +419,7 @@ meta_sync_ring_init (Display *xdisplay) g_return_val_if_fail (xdisplay != NULL, FALSE); g_return_val_if_fail (ring->xdisplay == NULL, FALSE); - if (!load_required_symbols ()) + if (!load_required_symbols (ctx)) return FALSE; if (!XSyncQueryExtension (xdisplay, &ring->xsync_event_base, &ring->xsync_error_base) || @@ -477,7 +479,8 @@ meta_sync_ring_destroy (void) } static gboolean -meta_sync_ring_reboot (Display *xdisplay) +meta_sync_ring_reboot (CoglContext *ctx, + Display *xdisplay) { MetaSyncRing *ring = meta_sync_ring_get (); @@ -494,11 +497,11 @@ meta_sync_ring_reboot (Display *xdisplay) return FALSE; } - return meta_sync_ring_init (xdisplay); + return meta_sync_ring_init (ctx, xdisplay); } gboolean -meta_sync_ring_after_frame (void) +meta_sync_ring_after_frame (CoglContext *ctx) { MetaSyncRing *ring = meta_sync_ring_get (); @@ -522,7 +525,7 @@ meta_sync_ring_after_frame (void) if (status != GL_ALREADY_SIGNALED && status != GL_CONDITION_SATISFIED) { meta_warning ("MetaSyncRing: Timed out waiting for sync object."); - return meta_sync_ring_reboot (ring->xdisplay); + return meta_sync_ring_reboot (ctx, ring->xdisplay); } meta_sync_reset (sync_to_reset); @@ -541,7 +544,7 @@ meta_sync_ring_after_frame (void) } gboolean -meta_sync_ring_insert_wait (void) +meta_sync_ring_insert_wait (CoglContext *ctx) { MetaSyncRing *ring = meta_sync_ring_get (); MetaSync *sync; @@ -562,7 +565,7 @@ meta_sync_ring_insert_wait (void) else if (sync->state != META_SYNC_STATE_READY) { meta_warning ("MetaSyncRing: Sync object is not ready -- were events handled properly?"); - if (!meta_sync_ring_reboot (ring->xdisplay)) + if (!meta_sync_ring_reboot (ctx, ring->xdisplay)) return FALSE; } diff --git a/src/compositor/meta-sync-ring.h b/src/compositor/meta-sync-ring.h index 0f96f51e3..6b82a349b 100644 --- a/src/compositor/meta-sync-ring.h +++ b/src/compositor/meta-sync-ring.h @@ -3,8 +3,11 @@ #include #include -gboolean meta_sync_ring_init (Display *dpy); +#include "cogl/cogl.h" + +gboolean meta_sync_ring_init (CoglContext *ctx, + Display *dpy); void meta_sync_ring_destroy (void); -gboolean meta_sync_ring_after_frame (void); -gboolean meta_sync_ring_insert_wait (void); +gboolean meta_sync_ring_after_frame (CoglContext *ctx); +gboolean meta_sync_ring_insert_wait (CoglContext *ctx); void meta_sync_ring_handle_event (XEvent *event);