diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h index 09931a85b..d0017e676 100644 --- a/cogl/cogl/cogl-context-private.h +++ b/cogl/cogl/cogl-context-private.h @@ -48,7 +48,6 @@ #include "cogl/cogl-framebuffer-private.h" #include "cogl/cogl-offscreen-private.h" #include "cogl/cogl-onscreen-private.h" -#include "cogl/cogl-poll-private.h" #include "cogl/cogl-private.h" #include "cogl/winsys/cogl-winsys-private.h" diff --git a/cogl/cogl/cogl-glib-source.c b/cogl/cogl/cogl-glib-source.c index fc87dc0c6..f526cc663 100644 --- a/cogl/cogl/cogl-glib-source.c +++ b/cogl/cogl/cogl-glib-source.c @@ -30,8 +30,8 @@ #include "config.h" +#include "cogl/cogl-renderer-private.h" #include "cogl/cogl-glib-source.h" -#include "cogl/cogl-poll.h" typedef struct _CoglGLibSource { @@ -47,7 +47,7 @@ cogl_glib_source_prepare (GSource *source, int *timeout) { CoglGLibSource *cogl_source = (CoglGLibSource *) source; - if (!cogl_poll_renderer_has_idle_closures (cogl_source->renderer)) + if (_cogl_list_empty (&cogl_source->renderer->idle_closures)) { *timeout = -1; cogl_source->expiration_time = -1; @@ -81,7 +81,7 @@ cogl_glib_source_dispatch (GSource *source, { CoglGLibSource *cogl_source = (CoglGLibSource *) source; - cogl_poll_renderer_dispatch (cogl_source->renderer); + _cogl_closure_list_invoke_no_args (&cogl_source->renderer->idle_closures); return TRUE; } @@ -122,5 +122,3 @@ cogl_glib_source_new (CoglContext *context, return cogl_glib_renderer_source_new (cogl_context_get_renderer (context), priority); } - - diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index 93245267d..13bc54493 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -39,7 +39,7 @@ #include "cogl/cogl-onscreen-template-private.h" #include "cogl/cogl-context-private.h" #include "cogl/cogl-closure-list-private.h" -#include "cogl/cogl-poll-private.h" +#include "cogl/cogl-renderer-private.h" typedef struct _CoglOnscreenPrivate { @@ -223,11 +223,10 @@ _cogl_onscreen_queue_dispatch_idle (CoglOnscreen *onscreen) if (!ctx->onscreen_dispatch_idle) { ctx->onscreen_dispatch_idle = - _cogl_poll_renderer_add_idle (ctx->display->renderer, - (CoglIdleCallback) - _cogl_dispatch_onscreen_cb, - ctx, - NULL); + _cogl_closure_list_add (&ctx->display->renderer->idle_closures, + _cogl_dispatch_onscreen_cb, + ctx, + NULL); } } diff --git a/cogl/cogl/cogl-poll-private.h b/cogl/cogl/cogl-poll-private.h deleted file mode 100644 index 2dc22a238..000000000 --- a/cogl/cogl/cogl-poll-private.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2013 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. - * - * - */ - -#pragma once - -#include "cogl/cogl-poll.h" -#include "cogl/cogl-renderer.h" -#include "cogl/cogl-closure-list-private.h" - -typedef void (*CoglIdleCallback) (void *user_data); - -CoglClosure * -_cogl_poll_renderer_add_idle (CoglRenderer *renderer, - CoglIdleCallback idle_cb, - void *user_data, - GDestroyNotify destroy_cb); diff --git a/cogl/cogl/cogl-poll.c b/cogl/cogl/cogl-poll.c deleted file mode 100644 index 48eb11456..000000000 --- a/cogl/cogl/cogl-poll.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2012 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: - * Neil Roberts - */ - -#include "config.h" - -#include "cogl/cogl-poll.h" -#include "cogl/cogl-poll-private.h" -#include "cogl/cogl-renderer-private.h" -#include "cogl/winsys/cogl-winsys-private.h" - -gboolean -cogl_poll_renderer_has_idle_closures (CoglRenderer *renderer) -{ - g_return_val_if_fail (COGL_IS_RENDERER (renderer), FALSE); - - return !_cogl_list_empty (&renderer->idle_closures); -} - -void -cogl_poll_renderer_dispatch (CoglRenderer *renderer) -{ - g_return_if_fail (COGL_IS_RENDERER (renderer)); - - _cogl_closure_list_invoke_no_args (&renderer->idle_closures); -} - -CoglClosure * -_cogl_poll_renderer_add_idle (CoglRenderer *renderer, - CoglIdleCallback idle_cb, - void *user_data, - GDestroyNotify destroy_cb) -{ - return _cogl_closure_list_add (&renderer->idle_closures, - idle_cb, - user_data, - destroy_cb); -} diff --git a/cogl/cogl/cogl-poll.h b/cogl/cogl/cogl-poll.h deleted file mode 100644 index 47a0cb6a3..000000000 --- a/cogl/cogl/cogl-poll.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2012 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: - * Neil Roberts - */ - -#pragma once - -#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION) -#error "Only can be included directly." -#endif - -#include "cogl/cogl-context.h" - -#include - -#define COGL_SYSDEF_POLLIN POLLIN -#define COGL_SYSDEF_POLLPRI POLLPRI -#define COGL_SYSDEF_POLLOUT POLLOUT -#define COGL_SYSDEF_POLLERR POLLERR -#define COGL_SYSDEF_POLLHUP POLLHUP -#define COGL_SYSDEF_POLLNVAL POLLNVAL - -G_BEGIN_DECLS - -/** - * CoglPoll: - * - * Functions for integrating Cogl with an application's main loop - * - * Cogl needs to integrate with the application's main loop so that it - * can internally handle some events from the driver. All Cogl - * applications must use these functions. They provide enough - * information to describe the state that Cogl will need to wake up - * on. An application using the GLib main loop can instead use - * cogl_glib_source_new() which provides a #GSource ready to be added - * to the main loop. - */ - - -/** - * cogl_poll_renderer_has_idle_closures: - * @renderer: A #CoglRenderer - */ -COGL_EXPORT gboolean -cogl_poll_renderer_has_idle_closures (CoglRenderer *renderer); - -/** - * cogl_poll_renderer_dispatch: - * @renderer: A #CoglRenderer - * - * This should be called whenever an application is woken up from - * going idle in its main loop. - */ -COGL_EXPORT void -cogl_poll_renderer_dispatch (CoglRenderer *renderer); - -G_END_DECLS diff --git a/cogl/cogl/cogl-xlib-renderer.c b/cogl/cogl/cogl-xlib-renderer.c index d10ae2059..d84f09ea4 100644 --- a/cogl/cogl/cogl-xlib-renderer.c +++ b/cogl/cogl/cogl-xlib-renderer.c @@ -37,7 +37,6 @@ #include "cogl/cogl-renderer-private.h" #include "cogl/cogl-xlib-renderer-private.h" #include "cogl/cogl-x11-renderer-private.h" -#include "cogl/cogl-poll-private.h" #include "cogl/winsys/cogl-winsys-private.h" #include "mtk/mtk-x11.h" diff --git a/cogl/cogl/cogl.h b/cogl/cogl/cogl.h index 6e6a1e290..f85092fd4 100644 --- a/cogl/cogl/cogl.h +++ b/cogl/cogl/cogl.h @@ -85,7 +85,6 @@ #include "cogl/cogl-framebuffer.h" #include "cogl/cogl-onscreen.h" #include "cogl/cogl-frame-info.h" -#include "cogl/cogl-poll.h" #include "cogl/cogl-glib-source.h" #include "cogl/cogl-trace.h" #include "cogl/cogl-scanout.h" diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index 1a1d5d47c..a505378c3 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -45,7 +45,6 @@ cogl_headers = [ 'cogl-pipeline-layer-state.h', 'cogl-pipeline-state.h', 'cogl-pixel-buffer.h', - 'cogl-poll.h', 'cogl-primitive.h', 'cogl-renderer.h', 'cogl-scanout.h', @@ -242,8 +241,6 @@ cogl_sources = [ 'cogl-pixel-format.c', 'cogl-point-in-poly-private.h', 'cogl-point-in-poly.c', - 'cogl-poll-private.h', - 'cogl-poll.c', 'cogl-primitive-private.h', 'cogl-primitive.c', 'cogl-primitives-private.h', diff --git a/cogl/cogl/winsys/cogl-onscreen-glx.c b/cogl/cogl/winsys/cogl-onscreen-glx.c index eb11ea069..57acdd154 100644 --- a/cogl/cogl/winsys/cogl-onscreen-glx.c +++ b/cogl/cogl/winsys/cogl-onscreen-glx.c @@ -618,10 +618,10 @@ set_sync_pending (CoglOnscreen *onscreen) if (!glx_renderer->flush_notifications_idle) { glx_renderer->flush_notifications_idle = - _cogl_poll_renderer_add_idle (renderer, - flush_pending_notifications_idle, - context, - NULL); + _cogl_closure_list_add (&renderer->idle_closures, + flush_pending_notifications_idle, + context, + NULL); } onscreen_glx->pending_sync_notify++; @@ -642,10 +642,10 @@ set_complete_pending (CoglOnscreen *onscreen) if (!glx_renderer->flush_notifications_idle) { glx_renderer->flush_notifications_idle = - _cogl_poll_renderer_add_idle (renderer, - flush_pending_notifications_idle, - context, - NULL); + _cogl_closure_list_add (&renderer->idle_closures, + flush_pending_notifications_idle, + context, + NULL); } onscreen_glx->pending_complete_notify++; @@ -1016,10 +1016,10 @@ cogl_onscreen_glx_resize (CoglOnscreen *onscreen, if (!glx_renderer->flush_notifications_idle) { glx_renderer->flush_notifications_idle = - _cogl_poll_renderer_add_idle (renderer, - flush_pending_notifications_idle, - context, - NULL); + _cogl_closure_list_add (&renderer->idle_closures, + flush_pending_notifications_idle, + context, + NULL); } if (configure_event->send_event) diff --git a/cogl/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/cogl/winsys/cogl-winsys-egl-x11.c index 7393f79f6..aa44576ea 100644 --- a/cogl/cogl/winsys/cogl-winsys-egl-x11.c +++ b/cogl/cogl/winsys/cogl-winsys-egl-x11.c @@ -45,7 +45,6 @@ #include "cogl/cogl-texture-2d-private.h" #include "cogl/driver/gl/cogl-texture-2d-gl-private.h" #include "cogl/cogl-texture-2d.h" -#include "cogl/cogl-poll-private.h" #include "cogl/winsys/cogl-onscreen-egl.h" #include "cogl/winsys/cogl-onscreen-xlib.h" #include "cogl/winsys/cogl-winsys-egl-x11-private.h" diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c index f179553ac..166a03808 100644 --- a/cogl/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/cogl/winsys/cogl-winsys-glx.c @@ -45,7 +45,6 @@ #include "cogl/cogl-onscreen-private.h" #include "cogl/cogl-xlib-renderer.h" #include "cogl/cogl-util.h" -#include "cogl/cogl-poll-private.h" #include "cogl/driver/gl/cogl-pipeline-opengl-private.h" #include "cogl/winsys/cogl-glx-renderer-private.h" #include "cogl/winsys/cogl-glx-display-private.h" diff --git a/cogl/cogl/winsys/cogl-winsys-private.h b/cogl/cogl/winsys/cogl-winsys-private.h index 21ac6113e..00644e3f2 100644 --- a/cogl/cogl/winsys/cogl-winsys-private.h +++ b/cogl/cogl/winsys/cogl-winsys-private.h @@ -38,8 +38,6 @@ #include "cogl/winsys/cogl-texture-pixmap-x11-private.h" #endif -#include "cogl/cogl-poll.h" - COGL_EXPORT uint32_t _cogl_winsys_error_quark (void); diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c index 946af626f..1da8ffc71 100644 --- a/src/backends/native/meta-kms-impl-device.c +++ b/src/backends/native/meta-kms-impl-device.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include