diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index 214e0d9df..6aefd531c 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -414,16 +414,14 @@ int cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen) { CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); - const CoglWinsysVtable *winsys; + CoglOnscreenClass *klass = COGL_ONSCREEN_GET_CLASS (onscreen); g_return_val_if_fail (COGL_IS_ONSCREEN (framebuffer), 0); - winsys = _cogl_framebuffer_get_winsys (framebuffer); - - if (!winsys->onscreen_get_buffer_age) + if (!klass->get_buffer_age) return 0; - return winsys->onscreen_get_buffer_age (onscreen); + return klass->get_buffer_age (onscreen); } gboolean diff --git a/cogl/cogl/cogl-onscreen.h b/cogl/cogl/cogl-onscreen.h index 3b761cd3d..7284e04d5 100644 --- a/cogl/cogl/cogl-onscreen.h +++ b/cogl/cogl/cogl-onscreen.h @@ -79,6 +79,8 @@ struct _CoglOnscreenClass CoglFrameInfo *info, gpointer user_data, GError **error); + + int (* get_buffer_age) (CoglOnscreen *onscreen); }; #define COGL_SCANOUT_ERROR (cogl_scanout_error_quark ()) diff --git a/cogl/cogl/winsys/cogl-onscreen-egl.c b/cogl/cogl/winsys/cogl-onscreen-egl.c index 3bfa4ba0e..7e170f35a 100644 --- a/cogl/cogl/winsys/cogl-onscreen-egl.c +++ b/cogl/cogl/winsys/cogl-onscreen-egl.c @@ -163,8 +163,8 @@ cogl_onscreen_egl_bind (CoglOnscreen *onscreen) #define EGL_BUFFER_AGE_EXT 0x313D #endif -int -_cogl_winsys_onscreen_egl_get_buffer_age (CoglOnscreen *onscreen) +static int +cogl_onscreen_egl_get_buffer_age (CoglOnscreen *onscreen) { CoglOnscreenEgl *onscreen_egl = COGL_ONSCREEN_EGL (onscreen); CoglOnscreenEglPrivate *priv = @@ -354,4 +354,5 @@ cogl_onscreen_egl_class_init (CoglOnscreenEglClass *klass) onscreen_class->swap_buffers_with_damage = cogl_onscreen_egl_swap_buffers_with_damage; onscreen_class->swap_region = cogl_onscreen_egl_swap_region; + onscreen_class->get_buffer_age = cogl_onscreen_egl_get_buffer_age; } diff --git a/cogl/cogl/winsys/cogl-onscreen-egl.h b/cogl/cogl/winsys/cogl-onscreen-egl.h index 6843439f2..e152e1d6a 100644 --- a/cogl/cogl/winsys/cogl-onscreen-egl.h +++ b/cogl/cogl/winsys/cogl-onscreen-egl.h @@ -41,9 +41,6 @@ struct _CoglOnscreenEglClass CoglOnscreenClass parent_class; }; -int -_cogl_winsys_onscreen_egl_get_buffer_age (CoglOnscreen *onscreen); - COGL_EXPORT void cogl_onscreen_egl_set_platform (CoglOnscreenEgl *onscreen_egl, gpointer platform); diff --git a/cogl/cogl/winsys/cogl-onscreen-glx.c b/cogl/cogl/winsys/cogl-onscreen-glx.c index 54e9146f1..dd33f622c 100644 --- a/cogl/cogl/winsys/cogl-onscreen-glx.c +++ b/cogl/cogl/winsys/cogl-onscreen-glx.c @@ -517,8 +517,8 @@ _cogl_winsys_get_vsync_counter (CoglContext *ctx) #define GLX_BACK_BUFFER_AGE_EXT 0x20F4 #endif -int -_cogl_winsys_onscreen_glx_get_buffer_age (CoglOnscreen *onscreen) +static int +cogl_onscreen_glx_get_buffer_age (CoglOnscreen *onscreen) { CoglOnscreenGlx *onscreen_glx = COGL_ONSCREEN_GLX (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); @@ -1112,4 +1112,5 @@ cogl_onscreen_glx_class_init (CoglOnscreenGlxClass *klass) onscreen_class->swap_buffers_with_damage = cogl_onscreen_glx_swap_buffers_with_damage; onscreen_class->swap_region = cogl_onscreen_glx_swap_region; + onscreen_class->get_buffer_age = cogl_onscreen_glx_get_buffer_age; } diff --git a/cogl/cogl/winsys/cogl-onscreen-glx.h b/cogl/cogl/winsys/cogl-onscreen-glx.h index 81ac7be08..1051cb231 100644 --- a/cogl/cogl/winsys/cogl-onscreen-glx.h +++ b/cogl/cogl/winsys/cogl-onscreen-glx.h @@ -41,9 +41,6 @@ cogl_onscreen_glx_new (CoglContext *context, int width, int height); -int -_cogl_winsys_onscreen_glx_get_buffer_age (CoglOnscreen *onscreen); - void cogl_onscreen_glx_resize (CoglOnscreen *onscreen, XConfigureEvent *configure_event); diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c index fb2ab4be7..6e66041fa 100644 --- a/cogl/cogl/winsys/cogl-winsys-egl.c +++ b/cogl/cogl/winsys/cogl-winsys-egl.c @@ -636,7 +636,6 @@ static CoglWinsysVtable _cogl_winsys_vtable = .display_destroy = _cogl_winsys_display_destroy, .context_init = _cogl_winsys_context_init, .context_deinit = _cogl_winsys_context_deinit, - .onscreen_get_buffer_age = _cogl_winsys_onscreen_egl_get_buffer_age, #if defined(EGL_KHR_fence_sync) || defined(EGL_KHR_reusable_sync) .fence_add = _cogl_winsys_fence_add, diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c index df60c1986..3e90b6ec6 100644 --- a/cogl/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/cogl/winsys/cogl-winsys-glx.c @@ -1469,7 +1469,6 @@ static CoglWinsysVtable _cogl_winsys_vtable = .context_init = _cogl_winsys_context_init, .context_deinit = _cogl_winsys_context_deinit, .context_get_clock_time = _cogl_winsys_get_clock_time, - .onscreen_get_buffer_age = _cogl_winsys_onscreen_glx_get_buffer_age, /* X11 tfp support... */ /* XXX: instead of having a rather monolithic winsys vtable we could diff --git a/cogl/cogl/winsys/cogl-winsys-private.h b/cogl/cogl/winsys/cogl-winsys-private.h index dc150752a..788573f94 100644 --- a/cogl/cogl/winsys/cogl-winsys-private.h +++ b/cogl/cogl/winsys/cogl-winsys-private.h @@ -32,7 +32,6 @@ #define __COGL_WINSYS_PRIVATE_H #include "cogl-renderer.h" -#include "cogl-onscreen.h" #include "cogl-scanout.h" #ifdef COGL_HAS_XLIB_SUPPORT @@ -109,9 +108,6 @@ typedef struct _CoglWinsysVtable int64_t (*context_get_clock_time) (CoglContext *context); - int - (*onscreen_get_buffer_age) (CoglOnscreen *onscreen); - #ifdef COGL_HAS_XLIB_SUPPORT gboolean (*texture_pixmap_x11_create) (CoglTexturePixmapX11 *tex_pixmap);