[cogl/wip/rib/frame-synchronization: 28/32] rename SwapInfo to FrameInfo
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/rib/frame-synchronization: 28/32] rename SwapInfo to FrameInfo
- Date: Tue, 15 Jan 2013 17:20:16 +0000 (UTC)
commit c6bfc0f1c2996dba0db86db39d8b443c5556ea4d
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} | 28 ++++++------
cogl/{cogl-swap-info.h => cogl-frame-info.h} | 46 ++++++++++----------
cogl/cogl-glx-display-private.h | 2 +-
cogl/cogl-onscreen-private.h | 2 +-
cogl/cogl-onscreen.c | 26 ++++++------
cogl/cogl-onscreen.h | 4 +-
cogl/winsys/cogl-winsys-glx.c | 22 +++++-----
9 files changed, 74 insertions(+), 74 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index d03c84c..198b34e 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -104,7 +104,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 \
@@ -343,8 +343,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 2e67fb0..5d8ac13 100644
--- a/cogl/cogl-swap-info-private.h
+++ b/cogl/cogl-frame-info-private.h
@@ -21,14 +21,14 @@
*
*/
-#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"
#include "cogl-output.h"
-struct _CoglSwapInfo
+struct _CoglFrameInfo
{
CoglObject _parent;
@@ -39,6 +39,6 @@ struct _CoglSwapInfo
CoglOutput *output;
};
-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 63%
rename from cogl/cogl-swap-info.c
rename to cogl/cogl-frame-info.c
index dfb0c13..efb2adf 100644
--- a/cogl/cogl-swap-info.c
+++ b/cogl/cogl-frame-info.c
@@ -25,48 +25,48 @@
#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);
}
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_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;
}
CoglOutput *
-cogl_swap_info_get_output (CoglSwapInfo *info)
+cogl_frame_info_get_output (CoglFrameInfo *info)
{
return info->output;
}
diff --git a/cogl/cogl-swap-info.h b/cogl/cogl-frame-info.h
similarity index 69%
rename from cogl/cogl-swap-info.h
rename to cogl/cogl-frame-info.h
index 699c845..50d7008 100644
--- a/cogl/cogl-swap-info.h
+++ b/cogl/cogl-frame-info.h
@@ -28,8 +28,8 @@
#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 <cogl/cogl-output.h>
@@ -37,26 +37,26 @@
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_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.
@@ -65,11 +65,11 @@ cogl_is_swap_info (void *object);
* 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_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.
@@ -79,31 +79,31 @@ int64_t cogl_swap_info_get_frame_counter (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
* refreshes of the screen, and is equal to 1000000 / refresh_rate.
*
* <note>Some platforms can't associate a #CoglOutput with a
- * #CoglSwapInfo object but are able to report a refresh_interval via
+ * #CoglFrameInfo object but are able to report a refresh_interval via
* this api. Therefore if you need this information then this api is
- * more reliable than using cogl_swap_info_get_output() followed by
+ * more reliable than using cogl_frame_info_get_output() followed by
* cogl_output_get_refresh_rate().</note>
*
* Return value: the refresh interval, in microsecoonds.
* 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);
/**
- * cogl_swap_info_get_output:
- * @info: a #CoglSwapInfo object
+ * cogl_frame_info_get_output:
+ * @info: a #CoglFrameInfo object
*
* Gets the #CoglOutput that the swapped frame was presented to.
*
@@ -113,11 +113,11 @@ int64_t cogl_swap_info_get_refresh_interval (CoglSwapInfo *info);
* Stability: unstable
*/
CoglOutput *
-cogl_swap_info_get_output (CoglSwapInfo *info);
+cogl_frame_info_get_output (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 a90ac43..057c022 100644
--- a/cogl/cogl-onscreen-private.h
+++ b/cogl/cogl-onscreen-private.h
@@ -84,7 +84,7 @@ struct _CoglOnscreen
int64_t swap_frame_counter; /* frame counter at last all to
* cogl_onscreen_swap_region() or
* cogl_onscreen_swap_buffers() */
- GQueue pending_swap_infos;
+ GQueue pending_frame_infos;
void *winsys;
};
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index 374e0b9..f3e5b5a 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"
@@ -117,7 +117,7 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
CoglResizeNotifyEntry *resize_entry;
CoglSwapCompleteNotifyEntry *swap_entry;
- CoglSwapInfo *swap_info;
+ CoglFrameInfo *frame_info;
while ((resize_entry = COGL_TAILQ_FIRST (&onscreen->resize_callbacks)))
{
@@ -131,9 +131,9 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
g_slice_free (CoglSwapCompleteNotifyEntry, swap_entry);
}
- while ((swap_info = g_queue_pop_tail (&onscreen->pending_swap_infos)))
- cogl_object_unref (swap_info);
- g_queue_clear (&onscreen->pending_swap_infos);
+ while ((frame_info = g_queue_pop_tail (&onscreen->pending_frame_infos)))
+ cogl_object_unref (frame_info);
+ g_queue_clear (&onscreen->pending_frame_infos);
if (framebuffer->context->window_buffer == COGL_FRAMEBUFFER (onscreen))
framebuffer->context->window_buffer = NULL;
@@ -152,13 +152,13 @@ cogl_onscreen_swap_buffers (CoglOnscreen *onscreen)
{
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
const CoglWinsysVtable *winsys;
- CoglSwapInfo *info;
+ CoglFrameInfo *info;
_COGL_RETURN_IF_FAIL (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
- info = _cogl_swap_info_new ();
+ info = _cogl_frame_info_new ();
info->frame_counter = onscreen->frame_counter;
- g_queue_push_tail (&onscreen->pending_swap_infos, info);
+ g_queue_push_tail (&onscreen->pending_frame_infos, info);
/* FIXME: we shouldn't need to flush *all* journals here! */
cogl_flush ();
@@ -178,13 +178,13 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
{
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
const CoglWinsysVtable *winsys;
- CoglSwapInfo *info;
+ CoglFrameInfo *info;
_COGL_RETURN_IF_FAIL (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
- info = _cogl_swap_info_new ();
+ info = _cogl_frame_info_new ();
info->frame_counter = onscreen->frame_counter;
- g_queue_push_tail (&onscreen->pending_swap_infos, info);
+ g_queue_push_tail (&onscreen->pending_frame_infos, info);
/* FIXME: we shouldn't need to flush *all* journals here! */
cogl_flush ();
@@ -342,7 +342,7 @@ typedef struct _SwapBufferCallbackState
static void
shim_swap_buffers_callback (CoglOnscreen *onscreen,
- CoglSwapInfo *info,
+ CoglFrameInfo *info,
void *user_data)
{
SwapBufferCallbackState *state = user_data;
@@ -434,7 +434,7 @@ _cogl_onscreen_notify_swap_buffers (CoglOnscreen *onscreen)
list_node,
tmp)
{
- CoglSwapInfo *info = g_queue_pop_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_pop_tail (&onscreen->pending_frame_infos);
entry->callback (onscreen, info, entry->user_data);
}
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index d31aebc..c36113d 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>
#include <glib.h>
G_BEGIN_DECLS
@@ -351,7 +351,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
* Stability: unstable
*/
typedef void (*CoglSwapCompleteNotify) (CoglOnscreen *onscreen,
- CoglSwapInfo *info,
+ CoglFrameInfo *info,
void *user_data);
/**
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index dd88b8f..6f460b2 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
@@ -292,7 +292,7 @@ notify_swap_buffers (CoglContext *context, GLXBufferSwapComplete *swap_event)
if (swap_event->ust != 0)
{
- CoglSwapInfo *info = g_queue_peek_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_peek_tail (&onscreen->pending_frame_infos);
info->presentation_time =
ust_to_monotonic_time (context->display->renderer,
glx_onscreen->glxwin,
@@ -1357,7 +1357,7 @@ _cogl_winsys_wait_for_vblank (CoglOnscreen *onscreen)
if (glx_renderer->pf_glXWaitForMsc ||
glx_renderer->pf_glXGetVideoSync)
{
- CoglSwapInfo *info = g_queue_peek_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_peek_tail (&onscreen->pending_frame_infos);
if (glx_renderer->pf_glXWaitForMsc)
{
@@ -1408,11 +1408,11 @@ static void
set_refresh_interval_from_output (CoglOnscreen *onscreen,
CoglOutput *output)
{
-#warning "XXX: why not be consistent and also report a refresh_rate for the SwapInfo?"
+#warning "XXX: why not be consistent and also report a refresh_rate for the FrameInfo?"
float refresh_rate = cogl_output_get_refresh_rate (output);
if (refresh_rate != 0.0)
{
- CoglSwapInfo *info = g_queue_peek_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_peek_tail (&onscreen->pending_frame_infos);
info->refresh_interval = (int)(0.5 + (1000000. / refresh_rate));
}
}
@@ -1603,7 +1603,7 @@ _cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen,
if (!xlib_onscreen->is_foreign_xwin)
{
- CoglSwapInfo *info = g_queue_peek_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_peek_tail (&onscreen->pending_frame_infos);
x_min = CLAMP (x_min, 0, framebuffer_width);
x_max = CLAMP (x_max, 0, framebuffer_width);
@@ -1701,7 +1701,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
if (xlib_onscreen->output)
{
- CoglSwapInfo *info = g_queue_peek_tail (&onscreen->pending_swap_infos);
+ CoglFrameInfo *info = g_queue_peek_tail (&onscreen->pending_frame_infos);
info->output = xlib_onscreen->output;
}
}
@@ -2377,7 +2377,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;
}
@@ -2420,14 +2420,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]