[mutter] cogl: Remove unused deprecated cogl_onscreen_{add, remove}_swap_buffers_callback



commit 1076b31464580773678eb31677ef6e78637e6124
Author: Adam Jackson <ajax redhat com>
Date:   Tue Oct 29 15:06:07 2019 -0400

    cogl: Remove unused deprecated cogl_onscreen_{add,remove}_swap_buffers_callback
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/933

 cogl/cogl/cogl-onscreen.c | 72 -----------------------------------------------
 cogl/cogl/cogl-onscreen.h | 52 ----------------------------------
 cogl/cogl/cogl.symbols    |  2 --
 3 files changed, 126 deletions(-)
---
diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c
index e5e7ac711..eafc750ae 100644
--- a/cogl/cogl/cogl-onscreen.c
+++ b/cogl/cogl/cogl-onscreen.c
@@ -445,78 +445,6 @@ cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
   _cogl_closure_disconnect (closure);
 }
 
-typedef struct _SwapBufferCallbackState
-{
-  CoglSwapBuffersNotify callback;
-  void *user_data;
-} SwapBufferCallbackState;
-
-static void
-destroy_swap_buffers_callback_state (void *user_data)
-{
-  g_slice_free (SwapBufferCallbackState, user_data);
-}
-
-static void
-shim_swap_buffers_callback (CoglOnscreen *onscreen,
-                            CoglFrameEvent event,
-                            CoglFrameInfo *info,
-                            void *user_data)
-{
-  SwapBufferCallbackState *state = user_data;
-
-  /* XXX: Note that technically it is a change in semantics for this
-   * interface to forward _SYNC events here and also makes the api
-   * name somewhat missleading.
-   *
-   * In practice though this interface is currently used by
-   * applications for throttling, not because they are strictly
-   * interested in knowing when a frame has been presented and so
-   * forwarding _SYNC events should serve them better.
-   */
-  if (event == COGL_FRAME_EVENT_SYNC)
-    state->callback (COGL_FRAMEBUFFER (onscreen), state->user_data);
-}
-
-unsigned int
-cogl_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen,
-                                         CoglSwapBuffersNotify callback,
-                                         void *user_data)
-{
-  CoglContext *ctx = COGL_FRAMEBUFFER (onscreen)->context;
-  SwapBufferCallbackState *state = g_slice_new (SwapBufferCallbackState);
-  CoglFrameClosure *closure;
-  unsigned int id = ctx->next_swap_callback_id++;
-
-  state->callback = callback;
-  state->user_data = user_data;
-
-  closure =
-    cogl_onscreen_add_frame_callback (onscreen,
-                                      shim_swap_buffers_callback,
-                                      state,
-                                      destroy_swap_buffers_callback_state);
-
-  g_hash_table_insert (ctx->swap_callback_closures,
-                       GINT_TO_POINTER (id),
-                       closure);
-
-  return id;
-}
-
-void
-cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
-                                            unsigned int id)
-{
-  CoglContext *ctx = COGL_FRAMEBUFFER (onscreen)->context;
-  CoglFrameClosure *closure = g_hash_table_lookup (ctx->swap_callback_closures,
-                                                   GINT_TO_POINTER (id));
-
-  g_return_if_fail (closure);
-
-  cogl_onscreen_remove_frame_callback (onscreen, closure);
-}
-
 void
 cogl_onscreen_show (CoglOnscreen *onscreen)
 {
diff --git a/cogl/cogl/cogl-onscreen.h b/cogl/cogl/cogl-onscreen.h
index 4d76d5bf4..d339025c5 100644
--- a/cogl/cogl/cogl-onscreen.h
+++ b/cogl/cogl/cogl-onscreen.h
@@ -453,58 +453,6 @@ void
 cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
                                      CoglFrameClosure *closure);
 
-typedef void (*CoglSwapBuffersNotify) (CoglFramebuffer *framebuffer,
-                                       void *user_data);
-
-/**
- * cogl_onscreen_add_swap_buffers_callback:
- * @onscreen: A #CoglOnscreen framebuffer
- * @callback: (scope notified): A callback function to call when a swap
- *            has completed
- * @user_data: (closure): A private pointer to be passed to @callback
- *
- * Installs a @callback function that should be called whenever a swap buffers
- * request (made using cogl_onscreen_swap_buffers()) for the given
- * @onscreen completes.
- *
- * <note>Applications should check for the %COGL_FEATURE_ID_SWAP_BUFFERS_EVENT
- * feature before using this API. It's currently undefined when and if
- * registered callbacks will be called if this feature is not supported.</note>
- *
- * We recommend using this mechanism when available to manually throttle your
- * applications so your application will be able to avoid long blocks in the
- * driver caused by throttling when you request to swap buffers too quickly.
- *
- * Return value: a unique identifier that can be used to remove to remove
- *               the callback later.
- * Since: 1.10
- * Stability: unstable
- * Deprecated: 1.14: Use cogl_onscreen_add_frame_callback() instead
- */
-COGL_DEPRECATED_FOR (cogl_onscreen_add_frame_callback)
-unsigned int
-cogl_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen,
-                                         CoglSwapBuffersNotify callback,
-                                         void *user_data);
-
-/**
- * cogl_onscreen_remove_swap_buffers_callback:
- * @onscreen: A #CoglOnscreen framebuffer
- * @id: An identifier returned from cogl_onscreen_add_swap_buffers_callback()
- *
- * Removes a callback that was previously registered
- * using cogl_onscreen_add_swap_buffers_callback().
- *
- * Since: 1.10
- * Stability: unstable
- * Deprecated: 1.14: Use cogl_onscreen_remove_frame_callback() instead
- */
-
-COGL_DEPRECATED_FOR (cogl_onscreen_remove_frame_callback)
-void
-cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
-                                            unsigned int id);
-
 /**
  * cogl_onscreen_set_resizable:
  * @onscreen: A #CoglOnscreen framebuffer
diff --git a/cogl/cogl/cogl.symbols b/cogl/cogl/cogl.symbols
index 225b44b24..52f49dd3d 100644
--- a/cogl/cogl/cogl.symbols
+++ b/cogl/cogl/cogl.symbols
@@ -495,7 +495,6 @@ cogl_offscreen_new_with_texture
 cogl_onscreen_add_dirty_callback
 cogl_onscreen_add_frame_callback
 cogl_onscreen_add_resize_callback
-cogl_onscreen_add_swap_buffers_callback
 #ifndef COGL_WINSYS_INTEGRATED
 cogl_onscreen_clutter_backend_set_size_CLUTTER
 #endif
@@ -513,7 +512,6 @@ cogl_onscreen_new
 cogl_onscreen_remove_dirty_callback
 cogl_onscreen_remove_frame_callback
 cogl_onscreen_remove_resize_callback
-cogl_onscreen_remove_swap_buffers_callback
 #ifdef COGL_HAS_GTYPE_SUPPORT
 cogl_onscreen_resize_closure_get_gtype
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]