[cogl/wip/frame-synchronization: 214/223] rename SwapInfo to FrameInfo



commit 30ad78f96af0cc4bea8a1aca442500d16ba496e6
Author: Robert Bragg <robert linux intel com>
Date:   Wed Jan 9 20:46:43 2013 +0000

    rename SwapInfo to FrameInfo
    
    As discussed on the mailing list we can be slightly more consistent with gtk
    by using "frame" instead of "swap" here. Also we discussed the potential
    for being able to query information for a frame that's still in progress
    and in that case "swap" wouldn't make much sense.
    
    TODO: squash this back into owen's patch

 cogl/Makefile.am                                   |    6 +-
 ...ap-info-private.h => cogl-frame-info-private.h} |   12 ++--
 cogl/{cogl-swap-info.c => cogl-frame-info.c}       |   30 +++++-----
 cogl/{cogl-swap-info.h => cogl-frame-info.h}       |   52 ++++++++--------
 cogl/cogl-glx-display-private.h                    |    2 +-
 cogl/cogl-onscreen-private.h                       |   22 +++---
 cogl/cogl-onscreen.c                               |   66 ++++++++++----------
 cogl/cogl-onscreen.h                               |   52 ++++++++--------
 cogl/winsys/cogl-winsys-glx.c                      |   32 +++++-----
 9 files changed, 137 insertions(+), 137 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 53b42e9..727f12a 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -110,7 +110,7 @@ cogl_experimental_h = \
 	$(srcdir)/cogl-attribute.h 		\
 	$(srcdir)/cogl-primitive.h 		\
 	$(srcdir)/cogl-clip-state.h		\
-	$(srcdir)/cogl-swap-info.h		\
+	$(srcdir)/cogl-frame-info.h		\
 	$(srcdir)/cogl-framebuffer.h		\
 	$(srcdir)/cogl-onscreen.h		\
 	$(srcdir)/cogl-output.h			\
@@ -385,8 +385,8 @@ cogl_sources_c = \
 	$(srcdir)/cogl-spans.c				\
 	$(srcdir)/cogl-journal-private.h		\
 	$(srcdir)/cogl-journal.c			\
-	$(srcdir)/cogl-swap-info-private.h		\
-	$(srcdir)/cogl-swap-info.c			\
+	$(srcdir)/cogl-frame-info-private.h		\
+	$(srcdir)/cogl-frame-info.c			\
 	$(srcdir)/cogl-framebuffer-private.h		\
 	$(srcdir)/cogl-framebuffer.c 			\
 	$(srcdir)/cogl-onscreen-private.h		\
diff --git a/cogl/cogl-swap-info-private.h b/cogl/cogl-frame-info-private.h
similarity index 82%
rename from cogl/cogl-swap-info-private.h
rename to cogl/cogl-frame-info-private.h
index 2697d53..85a86c8 100644
--- a/cogl/cogl-swap-info-private.h
+++ b/cogl/cogl-frame-info-private.h
@@ -21,13 +21,13 @@
  *
  */
 
-#ifndef __COGL_SWAP_INFO_PRIVATE_H
-#define __COGL_SWAP_INFO_PRIVATE_H
+#ifndef __COGL_FRAME_INFO_PRIVATE_H
+#define __COGL_FRAME_INFO_PRIVATE_H
 
-#include "cogl-swap-info.h"
+#include "cogl-frame-info.h"
 #include "cogl-object-private.h"
 
-struct _CoglSwapInfo
+struct _CoglFrameInfo
 {
   CoglObject _parent;
 
@@ -39,6 +39,6 @@ struct _CoglSwapInfo
   unsigned int complete : 1;
 };
 
-CoglSwapInfo *_cogl_swap_info_new (void);
+CoglFrameInfo *_cogl_frame_info_new (void);
 
-#endif /* __COGL_SWAP_INFO_PRIVATE_H */
+#endif /* __COGL_FRAME_INFO_PRIVATE_H */
diff --git a/cogl/cogl-swap-info.c b/cogl/cogl-frame-info.c
similarity index 62%
rename from cogl/cogl-swap-info.c
rename to cogl/cogl-frame-info.c
index b2dda13..2a2e4ff 100644
--- a/cogl/cogl-swap-info.c
+++ b/cogl/cogl-frame-info.c
@@ -25,54 +25,54 @@
 #include "config.h"
 #endif
 
-#include "cogl-swap-info-private.h"
+#include "cogl-frame-info-private.h"
 
-static void _cogl_swap_info_free (CoglSwapInfo *info);
+static void _cogl_frame_info_free (CoglFrameInfo *info);
 
-COGL_OBJECT_DEFINE (SwapInfo, swap_info);
+COGL_OBJECT_DEFINE (FrameInfo, frame_info);
 
-CoglSwapInfo *
-_cogl_swap_info_new (void)
+CoglFrameInfo *
+_cogl_frame_info_new (void)
 {
-  CoglSwapInfo *info;
+  CoglFrameInfo *info;
 
-  info = g_slice_new0 (CoglSwapInfo);
+  info = g_slice_new0 (CoglFrameInfo);
 
-  return _cogl_swap_info_object_new (info);
+  return _cogl_frame_info_object_new (info);
 }
 
 static void
-_cogl_swap_info_free (CoglSwapInfo *info)
+_cogl_frame_info_free (CoglFrameInfo *info)
 {
-  g_slice_free (CoglSwapInfo, info);
+  g_slice_free (CoglFrameInfo, info);
 }
 
 CoglBool
-cogl_swap_info_get_complete (CoglSwapInfo *info)
+cogl_frame_info_get_complete (CoglFrameInfo *info)
 {
   return info->complete;
 }
 
 int64_t
-cogl_swap_info_get_frame_counter (CoglSwapInfo *info)
+cogl_frame_info_get_frame_counter (CoglFrameInfo *info)
 {
   return info->frame_counter;
 }
 
 int64_t
-cogl_swap_info_get_frame_time (CoglSwapInfo *info)
+cogl_frame_info_get_frame_time (CoglFrameInfo *info)
 {
   return info->frame_time;
 }
 
 int64_t
-cogl_swap_info_get_presentation_time (CoglSwapInfo *info)
+cogl_frame_info_get_presentation_time (CoglFrameInfo *info)
 {
   return info->presentation_time;
 }
 
 int64_t
-cogl_swap_info_get_refresh_interval (CoglSwapInfo *info)
+cogl_frame_info_get_refresh_interval (CoglFrameInfo *info)
 {
   return info->refresh_interval;
 }
diff --git a/cogl/cogl-swap-info.h b/cogl/cogl-frame-info.h
similarity index 67%
rename from cogl/cogl-swap-info.h
rename to cogl/cogl-frame-info.h
index 710d005..725d1f8 100644
--- a/cogl/cogl-swap-info.h
+++ b/cogl/cogl-frame-info.h
@@ -28,48 +28,48 @@
 #error "Only <cogl/cogl.h> can be included directly."
 #endif
 
-#ifndef __COGL_SWAP_INFO_H
-#define __COGL_SWAP_INFO_H
+#ifndef __COGL_FRAME_INFO_H
+#define __COGL_FRAME_INFO_H
 
 #include <cogl/cogl-types.h>
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-typedef struct _CoglSwapInfo CoglSwapInfo;
-#define COGL_SWAP_INFO(X) ((CoglSwapInfo *)(X))
+typedef struct _CoglFrameInfo CoglFrameInfo;
+#define COGL_FRAME_INFO(X) ((CoglFrameInfo *)(X))
 
 /**
- * cogl_is_swap_info:
+ * cogl_is_frame_info:
  * @object: A #CoglObject pointer
  *
- * Gets whether the given object references a #CoglSwapInfo.
+ * Gets whether the given object references a #CoglFrameInfo.
  *
- * Return value: %TRUE if the object references a #CoglSwapInfo
+ * Return value: %TRUE if the object references a #CoglFrameInfo
  *   and %FALSE otherwise.
  * Since: 2.0
  * Stability: unstable
  */
 CoglBool
-cogl_is_swap_info (void *object);
+cogl_is_frame_info (void *object);
 
 /**
- * cogl_swap_info_get_complete:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_complete:
+ * @info: a #CoglFrameInfo object
  *
  * Gets whether all information that will potentially be provided for
- * the frame has been provided. Once a swap info object is complete,
+ * the frame has been provided. Once a frame info object is complete,
  * no further changes will be made to it.
  *
- * Return value: whether the swap info object is complete.
+ * Return value: whether the frame info object is complete.
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool cogl_swap_info_get_complete (CoglSwapInfo *info);
+CoglBool cogl_frame_info_get_complete (CoglFrameInfo *info);
 
 /**
- * cogl_swap_info_get_frame_counter:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_frame_counter:
+ * @info: a #CoglFrameInfo object
  *
  * Gets the frame counter for the #CoglOnscreen that corresponds
  * to this frame.
@@ -78,11 +78,11 @@ CoglBool cogl_swap_info_get_complete (CoglSwapInfo *info);
  * Since: 2.0
  * Stability: unstable
  */
-int64_t cogl_swap_info_get_frame_counter (CoglSwapInfo *info);
+int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
 
 /**
- * cogl_swap_info_get_frame_time:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_frame_time:
+ * @info: a #CoglFrameInfo object
  *
  * Gets the time used for creating content for the frame. This
  * is determined by the time passed to cogl_onscreen_begin_frame(),
@@ -94,11 +94,11 @@ int64_t cogl_swap_info_get_frame_counter (CoglSwapInfo *info);
  * Since: 2.0
  * Stability: unstable
  */
-int64_t cogl_swap_info_get_frame_time (CoglSwapInfo *info);
+int64_t cogl_frame_info_get_frame_time (CoglFrameInfo *info);
 
 /**
- * cogl_swap_info_get_presentation_time:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_presentation_time:
+ * @info: a #CoglFrameInfo object
  *
  * Gets the presentation time for the frame. This is the time at which
  * the frame became visible to the user.
@@ -108,11 +108,11 @@ int64_t cogl_swap_info_get_frame_time (CoglSwapInfo *info);
  * Since: 2.0
  * Stability: unstable
  */
-int64_t cogl_swap_info_get_presentation_time (CoglSwapInfo *info);
+int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
 
 /**
- * cogl_swap_info_get_refresh_interval:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_refresh_interval:
+ * @info: a #CoglFrameInfo object
  *
  * Gets the refresh interval for the output that the frame was on at the
  * time the frame was presented. This is the number of microseconds between
@@ -123,11 +123,11 @@ int64_t cogl_swap_info_get_presentation_time (CoglSwapInfo *info);
  * Since: 2.0
  * Stability: unstable
  */
-int64_t cogl_swap_info_get_refresh_interval (CoglSwapInfo *info);
+int64_t cogl_frame_info_get_refresh_interval (CoglFrameInfo *info);
 
 G_END_DECLS
 
-#endif /* __COGL_SWAP_INFO_H */
+#endif /* __COGL_FRAME_INFO_H */
 
 
 
diff --git a/cogl/cogl-glx-display-private.h b/cogl/cogl-glx-display-private.h
index 5721d76..fb7f395 100644
--- a/cogl/cogl-glx-display-private.h
+++ b/cogl/cogl-glx-display-private.h
@@ -52,7 +52,7 @@ typedef struct _CoglGLXDisplay
   Window dummy_xwin;
   CoglBool pending_swap_notify;
   CoglBool pending_resize_notify;
-  CoglBool pending_swap_info_notify;
+  CoglBool pending_frame_info_notify;
 } CoglGLXDisplay;
 
 #endif /* __COGL_DISPLAY_GLX_PRIVATE_H */
diff --git a/cogl/cogl-onscreen-private.h b/cogl/cogl-onscreen-private.h
index 08fd5ec..e6c2b42 100644
--- a/cogl/cogl-onscreen-private.h
+++ b/cogl/cogl-onscreen-private.h
@@ -33,7 +33,7 @@
 #include <windows.h>
 #endif
 
-#define COGL_ONSCREEN_MAX_SWAP_INFOS 16
+#define COGL_ONSCREEN_MAX_FRAME_INFOS 16
 
 typedef struct _CoglSwapBuffersNotifyEntry CoglSwapBuffersNotifyEntry;
 
@@ -61,15 +61,15 @@ struct _CoglResizeNotifyEntry
   unsigned int id;
 };
 
-typedef struct _CoglSwapInfoCallbackEntry CoglSwapInfoCallbackEntry;
+typedef struct _CoglFrameInfoCallbackEntry CoglFrameInfoCallbackEntry;
 
-COGL_TAILQ_HEAD (CoglSwapInfoCallbackList, CoglSwapInfoCallbackEntry);
+COGL_TAILQ_HEAD (CoglFrameInfoCallbackList, CoglFrameInfoCallbackEntry);
 
-struct _CoglSwapInfoCallbackEntry
+struct _CoglFrameInfoCallbackEntry
 {
-  COGL_TAILQ_ENTRY (CoglSwapInfoCallbackEntry) list_node;
+  COGL_TAILQ_ENTRY (CoglFrameInfoCallbackEntry) list_node;
 
-  CoglSwapInfoCallback callback;
+  CoglFrameInfoCallback callback;
   void *user_data;
   unsigned int id;
 };
@@ -95,15 +95,15 @@ struct _CoglOnscreen
   CoglBool resizable;
   CoglResizeNotifyList resize_callbacks;
 
-  CoglSwapInfoCallbackList swap_info_callbacks;
+  CoglFrameInfoCallbackList frame_info_callbacks;
 
   int64_t frame_counter;
   int64_t swap_frame_counter; /* frame counter at last all to
                                * cogl_onscreen_swap_region() or
                                * cogl_onscreen_swap_buffers() */
-  CoglSwapInfo *swap_info[COGL_ONSCREEN_MAX_SWAP_INFOS];
-  int current_swap_info;
-  int n_swap_infos;
+  CoglFrameInfo *frame_info[COGL_ONSCREEN_MAX_FRAME_INFOS];
+  int current_frame_info;
+  int n_frame_infos;
 
   void *winsys;
 };
@@ -122,6 +122,6 @@ void
 _cogl_onscreen_notify_resize (CoglOnscreen *onscreen);
 
 void
-_cogl_onscreen_notify_swap_info (CoglOnscreen *onscreen);
+_cogl_onscreen_notify_frame_info (CoglOnscreen *onscreen);
 
 #endif /* __COGL_ONSCREEN_PRIVATE_H */
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index a7edd14..52490b6 100644
--- a/cogl/cogl-onscreen.c
+++ b/cogl/cogl-onscreen.c
@@ -27,7 +27,7 @@
 
 #include "cogl-util.h"
 #include "cogl-onscreen-private.h"
-#include "cogl-swap-info-private.h"
+#include "cogl-frame-info-private.h"
 #include "cogl-framebuffer-private.h"
 #include "cogl-onscreen-template-private.h"
 #include "cogl-context-private.h"
@@ -50,7 +50,7 @@ _cogl_onscreen_init_from_template (CoglOnscreen *onscreen,
 
   COGL_TAILQ_INIT (&onscreen->swap_callbacks);
   COGL_TAILQ_INIT (&onscreen->resize_callbacks);
-  COGL_TAILQ_INIT (&onscreen->swap_info_callbacks);
+  COGL_TAILQ_INIT (&onscreen->frame_info_callbacks);
 
   framebuffer->config = onscreen_template->config;
   cogl_object_ref (framebuffer->config.swap_chain);
@@ -80,7 +80,7 @@ _cogl_onscreen_new (void)
   COGL_FRAMEBUFFER (onscreen)->allocated = TRUE;
 
   onscreen->frame_counter = -1;
-  onscreen->current_swap_info = COGL_ONSCREEN_MAX_SWAP_INFOS - 1;
+  onscreen->current_frame_info = COGL_ONSCREEN_MAX_FRAME_INFOS - 1;
 
   /* XXX: Note we don't initialize onscreen->winsys in this case. */
 
@@ -474,16 +474,16 @@ cogl_onscreen_begin_frame (CoglOnscreen *onscreen,
                            int64_t frame_time)
 {
   onscreen->frame_counter++;
-  onscreen->current_swap_info = (onscreen->current_swap_info + 1) % COGL_ONSCREEN_MAX_SWAP_INFOS;
+  onscreen->current_frame_info = (onscreen->current_frame_info + 1) % COGL_ONSCREEN_MAX_FRAME_INFOS;
 
-  if (onscreen->n_swap_infos < COGL_ONSCREEN_MAX_SWAP_INFOS)
-    onscreen->n_swap_infos++;
+  if (onscreen->n_frame_infos < COGL_ONSCREEN_MAX_FRAME_INFOS)
+    onscreen->n_frame_infos++;
   else
-    cogl_object_unref (onscreen->swap_info[onscreen->current_swap_info]);
+    cogl_object_unref (onscreen->frame_info[onscreen->current_frame_info]);
 
-  onscreen->swap_info[onscreen->current_swap_info] = _cogl_swap_info_new ();
-  onscreen->swap_info[onscreen->current_swap_info]->frame_counter = onscreen->frame_counter;
-  onscreen->swap_info[onscreen->current_swap_info]->frame_time = frame_time;
+  onscreen->frame_info[onscreen->current_frame_info] = _cogl_frame_info_new ();
+  onscreen->frame_info[onscreen->current_frame_info]->frame_counter = onscreen->frame_counter;
+  onscreen->frame_info[onscreen->current_frame_info]->frame_time = frame_time;
 }
 
 static void
@@ -498,69 +498,69 @@ cogl_onscreen_before_swap (CoglOnscreen *onscreen)
 int64_t
 cogl_onscreen_get_frame_history_start (CoglOnscreen *onscreen)
 {
-  return onscreen->frame_counter - onscreen->n_swap_infos;
+  return onscreen->frame_counter - onscreen->n_frame_infos;
 }
 
-CoglSwapInfo *
-cogl_onscreen_get_swap_info (CoglOnscreen *onscreen,
-                                 int64_t       frame_counter)
+CoglFrameInfo *
+cogl_onscreen_get_frame_info (CoglOnscreen *onscreen,
+                              int64_t       frame_counter)
 {
   int pos;
 
   if (frame_counter > onscreen->frame_counter)
     return NULL;
 
-  if (frame_counter <= onscreen->frame_counter - onscreen->n_swap_infos)
+  if (frame_counter <= onscreen->frame_counter - onscreen->n_frame_infos)
     return NULL;
 
-  pos = ((onscreen->current_swap_info -
-          (onscreen->frame_counter - frame_counter) + COGL_ONSCREEN_MAX_SWAP_INFOS)
-         % COGL_ONSCREEN_MAX_SWAP_INFOS);
+  pos = ((onscreen->current_frame_info -
+          (onscreen->frame_counter - frame_counter) + COGL_ONSCREEN_MAX_FRAME_INFOS)
+         % COGL_ONSCREEN_MAX_FRAME_INFOS);
 
-  return onscreen->swap_info[pos];
+  return onscreen->frame_info[pos];
 }
 
 unsigned int
-cogl_onscreen_add_swap_info_callback (CoglOnscreen *onscreen,
-                                          CoglSwapInfoCallback callback,
-                                          void *user_data)
+cogl_onscreen_add_frame_info_callback (CoglOnscreen *onscreen,
+                                       CoglFrameInfoCallback callback,
+                                       void *user_data)
 {
-  CoglSwapInfoCallbackEntry *entry = g_slice_new (CoglSwapInfoCallbackEntry);
+  CoglFrameInfoCallbackEntry *entry = g_slice_new (CoglFrameInfoCallbackEntry);
   static int next_resize_callback_id = 0;
 
   entry->callback = callback;
   entry->user_data = user_data;
   entry->id = next_resize_callback_id++;
 
-  COGL_TAILQ_INSERT_TAIL (&onscreen->swap_info_callbacks, entry, list_node);
+  COGL_TAILQ_INSERT_TAIL (&onscreen->frame_info_callbacks, entry, list_node);
 
   return entry->id;
 }
 
 void
-cogl_onscreen_remove_swap_info_callback (CoglOnscreen *onscreen,
-                                             unsigned int id)
+cogl_onscreen_remove_frame_info_callback (CoglOnscreen *onscreen,
+                                          unsigned int id)
 {
-  CoglSwapInfoCallbackEntry *entry;
+  CoglFrameInfoCallbackEntry *entry;
 
-  COGL_TAILQ_FOREACH (entry, &onscreen->swap_info_callbacks, list_node)
+  COGL_TAILQ_FOREACH (entry, &onscreen->frame_info_callbacks, list_node)
     {
       if (entry->id == id)
         {
-          COGL_TAILQ_REMOVE (&onscreen->swap_info_callbacks, entry, list_node);
-          g_slice_free (CoglSwapInfoCallbackEntry, entry);
+          COGL_TAILQ_REMOVE (&onscreen->frame_info_callbacks, entry, list_node);
+          g_slice_free (CoglFrameInfoCallbackEntry, entry);
           break;
         }
     }
 }
 
 void
-_cogl_onscreen_notify_swap_info (CoglOnscreen *onscreen)
+_cogl_onscreen_notify_frame_info (CoglOnscreen *onscreen)
 {
-  CoglSwapInfoCallbackEntry *entry, *tmp;
+  CoglFrameInfoCallbackEntry *entry, *tmp;
 
   COGL_TAILQ_FOREACH_SAFE (entry,
-                           &onscreen->swap_info_callbacks,
+                           &onscreen->frame_info_callbacks,
                            list_node,
                            tmp)
     entry->callback (onscreen, entry->user_data);
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 47d35c1..e872b90 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -34,7 +34,7 @@
 
 #include <cogl/cogl-context.h>
 #include <cogl/cogl-framebuffer.h>
-#include <cogl/cogl-swap-info.h>
+#include <cogl/cogl-frame-info.h>
 
 COGL_BEGIN_DECLS
 
@@ -554,7 +554,7 @@ cogl_onscreen_get_frame_counter (CoglOnscreen *onscreen);
  *   content for this frame.
  *
  * Marks the beginning of a frame. This increases the frame
- * counter value and creates a new #CoglSwapInfo objeect.
+ * counter value and creates a new #CoglFrameInfo objeect.
  *
  * Since: 2.0
  */
@@ -566,11 +566,11 @@ cogl_onscreen_begin_frame (CoglOnscreen *onscreen,
  * cogl_onscreen_get_frame_history_start:
  * @onscreen: a #CoglOnscreen framebuffer
  *
- * Gets the frame counter for the oldest #CoglSwapInfo that is
- * being kept in the history. cogl_onscreen_get_swap_info() will
+ * Gets the frame counter for the oldest #CoglFrameInfo that is
+ * being kept in the history. cogl_onscreen_get_frame_info() will
  * always return %NULl for any frame counter before this.
  *
- * Return value: the frame counter for the oldest #CoglSwapInfo
+ * Return value: the frame counter for the oldest #CoglFrameInfo
  *  in the history.
  * Since: 2.0
  */
@@ -579,31 +579,31 @@ cogl_onscreen_get_frame_history_start (CoglOnscreen *onscreen);
 
 
 /**
- * cogl_onscreen_get_swap_info:
+ * cogl_onscreen_get_frame_info:
  * @onscreen: A #CoglOnscreen framebuffer
  * @frame_counter: the value of cogl_onscreen_get_frame_counter()
  *       when the frame finished drawing.
  *
  * Gets frame timing information for a particular frame.
  *
- * Return value: a #CoglSwapInfo object, or %NULL if swap info
+ * Return value: a #CoglFrameInfo object, or %NULL if
  *   information is not available for the given frame.
  * Since: 2.0
  */
-CoglSwapInfo *
-cogl_onscreen_get_swap_info (CoglOnscreen *onscreen,
-                             int64_t frame_counter);
+CoglFrameInfo *
+cogl_onscreen_get_frame_info (CoglOnscreen *onscreen,
+                              int64_t frame_counter);
 
 /**
- * CoglSwapInfoCallback:
+ * CoglFrameInfoCallback:
  * @onscreen: A #CoglOnscreen framebuffer that has updated timing information
  * @user_data: The private passed to
- *             cogl_onscreen_add_swap_info_callback()
+ *             cogl_onscreen_add_frame_info_callback()
  *
  * Is a callback type used with the
- * cogl_onscreen_add_swap_info_callback() allowing applications to be
+ * cogl_onscreen_add_frame_info_callback() allowing applications to be
  * notified whenever new frame timings information is available
- * via cogl_onscreen_get_swap_info().
+ * via cogl_onscreen_get_frame_info().
  *
  * <note>A frame timings callback will only ever be called while dispatching
  * Cogl events from the system mainloop; so for example during
@@ -613,17 +613,17 @@ cogl_onscreen_get_swap_info (CoglOnscreen *onscreen,
  *
  * Since: 2.0
  */
-typedef void (*CoglSwapInfoCallback) (CoglOnscreen *onscreen,
-                                      void *user_data);
+typedef void (*CoglFrameInfoCallback) (CoglOnscreen *onscreen,
+                                       void *user_data);
 
 /**
- * cogl_onscreen_add_swap_info_callback:
+ * cogl_onscreen_add_frame_info_callback:
  * @onscreen: A #CoglOnscreen framebuffer
  * @callback: A callback function to call when new frame timings information is available
  * @user_data: A private pointer to be passed to @callback
  *
  * Installs a @callback function that should be called whenever new data
- * is available via cogl_onscreen_get_swap_info().
+ * is available via cogl_onscreen_get_frame_info().
  *
  * Return value: a unique identifier that can be used to remove to remove
  *               the callback later.
@@ -631,24 +631,24 @@ typedef void (*CoglSwapInfoCallback) (CoglOnscreen *onscreen,
  * Stability: unstable
  */
 unsigned int
-cogl_onscreen_add_swap_info_callback (CoglOnscreen *onscreen,
-                                      CoglSwapInfoCallback callback,
-                                      void *user_data);
+cogl_onscreen_add_frame_info_callback (CoglOnscreen *onscreen,
+                                       CoglFrameInfoCallback callback,
+                                       void *user_data);
 
 /**
- * cogl_onscreen_remove_swap_info_callback:
+ * cogl_onscreen_remove_frame_info_callback:
  * @onscreen: A #CoglOnscreen framebuffer
- * @id: An identifier returned from cogl_onscreen_add_swap_info_callback()
+ * @id: An identifier returned from cogl_onscreen_add_frame_info_callback()
  *
  * Removes a callback that was previously registered
- * using cogl_onscreen_add_swap_info_callback().
+ * using cogl_onscreen_add_frame_info_callback().
  *
  * Since: 1.10
  * Stability: unstable
  */
 void
-cogl_onscreen_remove_swap_info_callback (CoglOnscreen *onscreen,
-                                         unsigned int id);
+cogl_onscreen_remove_frame_info_callback (CoglOnscreen *onscreen,
+                                          unsigned int id);
 
 COGL_END_DECLS
 
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index a62ccde..9843466 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -42,7 +42,7 @@
 #include "cogl-texture-2d-private.h"
 #include "cogl-texture-rectangle-private.h"
 #include "cogl-pipeline-opengl-private.h"
-#include "cogl-swap-info-private.h"
+#include "cogl-frame-info-private.h"
 #include "cogl-framebuffer-private.h"
 #include "cogl-onscreen-private.h"
 #include "cogl-swap-chain-private.h"
@@ -85,7 +85,7 @@ typedef struct _CoglOnscreenGLX
   uint32_t last_swap_vsync_counter;
   CoglBool pending_swap_notify;
   CoglBool pending_resize_notify;
-  CoglBool pending_swap_info_notify;
+  CoglBool pending_frame_info_notify;
 } CoglOnscreenGLX;
 
 typedef struct _CoglTexturePixmapGLX
@@ -283,12 +283,12 @@ set_info_complete (CoglOnscreen *onscreen)
   CoglContext *context = COGL_FRAMEBUFFER (onscreen)->context;
   CoglGLXDisplay *glx_display = context->display->winsys;
   int frame_counter = cogl_onscreen_get_frame_counter (onscreen);
-  CoglSwapInfo *info = cogl_onscreen_get_swap_info (onscreen, frame_counter);
+  CoglFrameInfo *info = cogl_onscreen_get_frame_info (onscreen, frame_counter);
 
   info->complete = TRUE;
 
-  glx_display->pending_swap_info_notify = TRUE;
-  glx_onscreen->pending_swap_info_notify = TRUE;
+  glx_display->pending_frame_info_notify = TRUE;
+  glx_onscreen->pending_frame_info_notify = TRUE;
 }
 
 static void
@@ -299,7 +299,7 @@ notify_swap_buffers (CoglContext *context, GLXBufferSwapComplete *swap_event)
   CoglGLXDisplay *glx_display = display->winsys;
   CoglOnscreenGLX *glx_onscreen;
   int frame_counter;
-  CoglSwapInfo *info;
+  CoglFrameInfo *info;
 
   if (!onscreen)
     return;
@@ -312,7 +312,7 @@ notify_swap_buffers (CoglContext *context, GLXBufferSwapComplete *swap_event)
   glx_onscreen->pending_swap_notify = TRUE;
 
   frame_counter = cogl_onscreen_get_frame_counter (onscreen);
-  info = cogl_onscreen_get_swap_info (onscreen, frame_counter);
+  info = cogl_onscreen_get_frame_info (onscreen, frame_counter);
   if (swap_event->ust != 0)
     info->presentation_time = ust_to_monotonic_time (context->display->renderer,
                                                         glx_onscreen->glxwin,
@@ -1408,10 +1408,10 @@ _cogl_winsys_wait_for_vblank (CoglOnscreen *onscreen)
       glx_renderer->glXGetVideoSync)
     {
       int frame_counter;
-      CoglSwapInfo *info;
+      CoglFrameInfo *info;
 
       frame_counter = cogl_onscreen_get_frame_counter (onscreen);
-      info = cogl_onscreen_get_swap_info (onscreen, frame_counter);
+      info = cogl_onscreen_get_frame_info (onscreen, frame_counter);
 
       if (glx_renderer->glXWaitForMsc)
         {
@@ -1464,7 +1464,7 @@ set_refresh_interval_from_output (CoglOnscreen *onscreen,
   if (refresh_rate != 0.0)
     {
       int frame_counter = cogl_onscreen_get_frame_counter (onscreen);
-      CoglSwapInfo *info = cogl_onscreen_get_swap_info (onscreen, frame_counter);
+      CoglFrameInfo *info = cogl_onscreen_get_frame_info (onscreen, frame_counter);
 
       info->refresh_interval = (int)(0.5 + (1000000. / refresh_rate));
     }
@@ -2421,7 +2421,7 @@ _cogl_winsys_poll_get_info (CoglContext *context,
      immediately */
   if (glx_display->pending_swap_notify ||
       glx_display->pending_resize_notify ||
-      glx_display->pending_swap_info_notify)
+      glx_display->pending_frame_info_notify)
     *timeout = 0;
 }
 
@@ -2448,10 +2448,10 @@ flush_pending_notifications_cb (void *data,
           glx_onscreen->pending_resize_notify = FALSE;
         }
 
-      if (glx_onscreen->pending_swap_info_notify)
+      if (glx_onscreen->pending_frame_info_notify)
         {
-          _cogl_onscreen_notify_swap_info (onscreen);
-          glx_onscreen->pending_swap_info_notify = FALSE;
+          _cogl_onscreen_notify_frame_info (onscreen);
+          glx_onscreen->pending_frame_info_notify = FALSE;
         }
     }
 }
@@ -2470,14 +2470,14 @@ _cogl_winsys_poll_dispatch (CoglContext *context,
 
   if (glx_display->pending_swap_notify ||
       glx_display->pending_resize_notify ||
-      glx_display->pending_swap_info_notify)
+      glx_display->pending_frame_info_notify)
     {
       g_list_foreach (context->framebuffers,
                       flush_pending_notifications_cb,
                       NULL);
       glx_display->pending_swap_notify = FALSE;
       glx_display->pending_resize_notify = FALSE;
-      glx_display->pending_swap_info_notify = FALSE;
+      glx_display->pending_frame_info_notify = FALSE;
     }
 }
 



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