[Cogl] [PATCH 2/4] rename SwapInfo to FrameInfo

Owen Taylor otaylor at redhat.com
Thu Jan 24 10:51:10 PST 2013


Looks fine.

Reviewed-by: Owen W. Taylor <otaylor at fishsoup.net>

On Fri, 2013-01-11 at 16:40 +0000, Robert Bragg wrote:
> From: Robert Bragg <robert at linux.intel.com>
> 
> 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 +-
>  cogl/cogl-frame-info-private.h  |   44 ++++++++++++++
>  cogl/cogl-frame-info.c          |   72 +++++++++++++++++++++++
>  cogl/cogl-frame-info.h          |  123 +++++++++++++++++++++++++++++++++++++++
>  cogl/cogl-glx-display-private.h |    2 +-
>  cogl/cogl-onscreen-private.h    |    2 +-
>  cogl/cogl-onscreen.c            |   26 ++++----
>  cogl/cogl-onscreen.h            |    4 +-
>  cogl/cogl-swap-info-private.h   |   44 --------------
>  cogl/cogl-swap-info.c           |   72 -----------------------
>  cogl/cogl-swap-info.h           |  123 ---------------------------------------
>  cogl/winsys/cogl-winsys-glx.c   |   22 ++++----
>  12 files changed, 270 insertions(+), 270 deletions(-)
>  create mode 100644 cogl/cogl-frame-info-private.h
>  create mode 100644 cogl/cogl-frame-info.c
>  create mode 100644 cogl/cogl-frame-info.h
>  delete mode 100644 cogl/cogl-swap-info-private.h
>  delete mode 100644 cogl/cogl-swap-info.c
>  delete mode 100644 cogl/cogl-swap-info.h
> 
> 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-frame-info-private.h b/cogl/cogl-frame-info-private.h
> new file mode 100644
> index 0000000..5d8ac13
> --- /dev/null
> +++ b/cogl/cogl-frame-info-private.h
> @@ -0,0 +1,44 @@
> +/*
> + * Cogl
> + *
> + * An object oriented GL/GLES Abstraction/Utility Layer
> + *
> + * Copyright (C) 2012 Red Hat, Inc.
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library. If not, see <http://www.gnu.org/licenses/>.
> + *
> + *
> + */
> +
> +#ifndef __COGL_FRAME_INFO_PRIVATE_H
> +#define __COGL_FRAME_INFO_PRIVATE_H
> +
> +#include "cogl-frame-info.h"
> +#include "cogl-object-private.h"
> +#include "cogl-output.h"
> +
> +struct _CoglFrameInfo
> +{
> +  CoglObject _parent;
> +
> +  int64_t frame_counter;
> +  int64_t presentation_time;
> +  int64_t refresh_interval;
> +
> +  CoglOutput *output;
> +};
> +
> +CoglFrameInfo *_cogl_frame_info_new (void);
> +
> +#endif /* __COGL_FRAME_INFO_PRIVATE_H */
> diff --git a/cogl/cogl-frame-info.c b/cogl/cogl-frame-info.c
> new file mode 100644
> index 0000000..efb2adf
> --- /dev/null
> +++ b/cogl/cogl-frame-info.c
> @@ -0,0 +1,72 @@
> +/*
> + * Cogl
> + *
> + * An object oriented GL/GLES Abstraction/Utility Layer
> + *
> + * Copyright (C) 2012 Red Hat, Inc.
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library. If not, see <http://www.gnu.org/licenses/>.
> + *
> + *
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include "cogl-frame-info-private.h"
> +
> +static void _cogl_frame_info_free (CoglFrameInfo *info);
> +
> +COGL_OBJECT_DEFINE (FrameInfo, frame_info);
> +
> +CoglFrameInfo *
> +_cogl_frame_info_new (void)
> +{
> +  CoglFrameInfo *info;
> +
> +  info = g_slice_new0 (CoglFrameInfo);
> +
> +  return _cogl_frame_info_object_new (info);
> +}
> +
> +static void
> +_cogl_frame_info_free (CoglFrameInfo *info)
> +{
> +  g_slice_free (CoglFrameInfo, info);
> +}
> +
> +int64_t
> +cogl_frame_info_get_frame_counter (CoglFrameInfo *info)
> +{
> +  return info->frame_counter;
> +}
> +
> +int64_t
> +cogl_frame_info_get_presentation_time (CoglFrameInfo *info)
> +{
> +  return info->presentation_time;
> +}
> +
> +int64_t
> +cogl_frame_info_get_refresh_interval (CoglFrameInfo *info)
> +{
> +  return info->refresh_interval;
> +}
> +
> +CoglOutput *
> +cogl_frame_info_get_output (CoglFrameInfo *info)
> +{
> +  return info->output;
> +}
> diff --git a/cogl/cogl-frame-info.h b/cogl/cogl-frame-info.h
> new file mode 100644
> index 0000000..50d7008
> --- /dev/null
> +++ b/cogl/cogl-frame-info.h
> @@ -0,0 +1,123 @@
> +/*
> + * Cogl
> + *
> + * An object oriented GL/GLES Abstraction/Utility Layer
> + *
> + * Copyright (C) 2012 Red Hat, Inc.
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library. If not, see
> + * <http://www.gnu.org/licenses/>.
> + *
> + *
> + *
> + * Authors:
> + *   Owen Taylor <otaylor at redhat.com>
> + */
> +#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
> +#error "Only <cogl/cogl.h> can be included directly."
> +#endif
> +
> +#ifndef __COGL_FRAME_INFO_H
> +#define __COGL_FRAME_INFO_H
> +
> +#include <cogl/cogl-types.h>
> +#include <cogl/cogl-output.h>
> +#include <glib.h>
> +
> +G_BEGIN_DECLS
> +
> +typedef struct _CoglFrameInfo CoglFrameInfo;
> +#define COGL_FRAME_INFO(X) ((CoglFrameInfo *)(X))
> +
> +/**
> + * cogl_is_frame_info:
> + * @object: A #CoglObject pointer
> + *
> + * Gets whether the given object references a #CoglFrameInfo.
> + *
> + * Return value: %TRUE if the object references a #CoglFrameInfo
> + *   and %FALSE otherwise.
> + * Since: 2.0
> + * Stability: unstable
> + */
> +CoglBool
> +cogl_is_frame_info (void *object);
> +
> +/**
> + * cogl_frame_info_get_frame_counter:
> + * @info: a #CoglFrameInfo object
> + *
> + * Gets the frame counter for the #CoglOnscreen that corresponds
> + * to this frame.
> + *
> + * Return value: The frame counter value
> + * Since: 2.0
> + * Stability: unstable
> + */
> +int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
> +
> +/**
> + * 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.
> + *
> + * Return value: the presentation time for the frame, in
> + *  the timescale of g_get_monotonic_time().
> + * Since: 2.0
> + * Stability: unstable
> + */
> +int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
> +
> +/**
> + * 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
> + * #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_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_frame_info_get_refresh_interval (CoglFrameInfo *info);
> +
> +/**
> + * cogl_frame_info_get_output:
> + * @info: a #CoglFrameInfo object
> + *
> + * Gets the #CoglOutput that the swapped frame was presented to.
> + *
> + * Return value: The #CoglOutput that the frame was presented to, or
> + *               %NULL if this could not be determined.
> + * Since: 2.0
> + * Stability: unstable
> + */
> +CoglOutput *
> +cogl_frame_info_get_output (CoglFrameInfo *info);
> +
> +G_END_DECLS
> +
> +#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/cogl-swap-info-private.h b/cogl/cogl-swap-info-private.h
> deleted file mode 100644
> index 2e67fb0..0000000
> --- a/cogl/cogl-swap-info-private.h
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -/*
> - * Cogl
> - *
> - * An object oriented GL/GLES Abstraction/Utility Layer
> - *
> - * Copyright (C) 2012 Red Hat, Inc.
> - *
> - * This library is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU Lesser General Public
> - * License as published by the Free Software Foundation; either
> - * version 2 of the License, or (at your option) any later version.
> - *
> - * This library is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - * Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public
> - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
> - *
> - *
> - */
> -
> -#ifndef __COGL_SWAP_INFO_PRIVATE_H
> -#define __COGL_SWAP_INFO_PRIVATE_H
> -
> -#include "cogl-swap-info.h"
> -#include "cogl-object-private.h"
> -#include "cogl-output.h"
> -
> -struct _CoglSwapInfo
> -{
> -  CoglObject _parent;
> -
> -  int64_t frame_counter;
> -  int64_t presentation_time;
> -  int64_t refresh_interval;
> -
> -  CoglOutput *output;
> -};
> -
> -CoglSwapInfo *_cogl_swap_info_new (void);
> -
> -#endif /* __COGL_SWAP_INFO_PRIVATE_H */
> diff --git a/cogl/cogl-swap-info.c b/cogl/cogl-swap-info.c
> deleted file mode 100644
> index dfb0c13..0000000
> --- a/cogl/cogl-swap-info.c
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -/*
> - * Cogl
> - *
> - * An object oriented GL/GLES Abstraction/Utility Layer
> - *
> - * Copyright (C) 2012 Red Hat, Inc.
> - *
> - * This library is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU Lesser General Public
> - * License as published by the Free Software Foundation; either
> - * version 2 of the License, or (at your option) any later version.
> - *
> - * This library is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - * Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public
> - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
> - *
> - *
> - */
> -
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#include "cogl-swap-info-private.h"
> -
> -static void _cogl_swap_info_free (CoglSwapInfo *info);
> -
> -COGL_OBJECT_DEFINE (SwapInfo, swap_info);
> -
> -CoglSwapInfo *
> -_cogl_swap_info_new (void)
> -{
> -  CoglSwapInfo *info;
> -
> -  info = g_slice_new0 (CoglSwapInfo);
> -
> -  return _cogl_swap_info_object_new (info);
> -}
> -
> -static void
> -_cogl_swap_info_free (CoglSwapInfo *info)
> -{
> -  g_slice_free (CoglSwapInfo, info);
> -}
> -
> -int64_t
> -cogl_swap_info_get_frame_counter (CoglSwapInfo *info)
> -{
> -  return info->frame_counter;
> -}
> -
> -int64_t
> -cogl_swap_info_get_presentation_time (CoglSwapInfo *info)
> -{
> -  return info->presentation_time;
> -}
> -
> -int64_t
> -cogl_swap_info_get_refresh_interval (CoglSwapInfo *info)
> -{
> -  return info->refresh_interval;
> -}
> -
> -CoglOutput *
> -cogl_swap_info_get_output (CoglSwapInfo *info)
> -{
> -  return info->output;
> -}
> diff --git a/cogl/cogl-swap-info.h b/cogl/cogl-swap-info.h
> deleted file mode 100644
> index 699c845..0000000
> --- a/cogl/cogl-swap-info.h
> +++ /dev/null
> @@ -1,123 +0,0 @@
> -/*
> - * Cogl
> - *
> - * An object oriented GL/GLES Abstraction/Utility Layer
> - *
> - * Copyright (C) 2012 Red Hat, Inc.
> - *
> - * This library is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU Lesser General Public
> - * License as published by the Free Software Foundation; either
> - * version 2 of the License, or (at your option) any later version.
> - *
> - * This library is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - * Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public
> - * License along with this library. If not, see
> - * <http://www.gnu.org/licenses/>.
> - *
> - *
> - *
> - * Authors:
> - *   Owen Taylor <otaylor at redhat.com>
> - */
> -#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
> -#error "Only <cogl/cogl.h> can be included directly."
> -#endif
> -
> -#ifndef __COGL_SWAP_INFO_H
> -#define __COGL_SWAP_INFO_H
> -
> -#include <cogl/cogl-types.h>
> -#include <cogl/cogl-output.h>
> -#include <glib.h>
> -
> -G_BEGIN_DECLS
> -
> -typedef struct _CoglSwapInfo CoglSwapInfo;
> -#define COGL_SWAP_INFO(X) ((CoglSwapInfo *)(X))
> -
> -/**
> - * cogl_is_swap_info:
> - * @object: A #CoglObject pointer
> - *
> - * Gets whether the given object references a #CoglSwapInfo.
> - *
> - * Return value: %TRUE if the object references a #CoglSwapInfo
> - *   and %FALSE otherwise.
> - * Since: 2.0
> - * Stability: unstable
> - */
> -CoglBool
> -cogl_is_swap_info (void *object);
> -
> -/**
> - * cogl_swap_info_get_frame_counter:
> - * @info: a #CoglSwapInfo object
> - *
> - * Gets the frame counter for the #CoglOnscreen that corresponds
> - * to this frame.
> - *
> - * Return value: The frame counter value
> - * Since: 2.0
> - * Stability: unstable
> - */
> -int64_t cogl_swap_info_get_frame_counter (CoglSwapInfo *info);
> -
> -/**
> - * cogl_swap_info_get_presentation_time:
> - * @info: a #CoglSwapInfo object
> - *
> - * Gets the presentation time for the frame. This is the time at which
> - * the frame became visible to the user.
> - *
> - * Return value: the presentation time for the frame, in
> - *  the timescale of g_get_monotonic_time().
> - * Since: 2.0
> - * Stability: unstable
> - */
> -int64_t cogl_swap_info_get_presentation_time (CoglSwapInfo *info);
> -
> -/**
> - * cogl_swap_info_get_refresh_interval:
> - * @info: a #CoglSwapInfo 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
> - * this api. Therefore if you need this information then this api is
> - * more reliable than using cogl_swap_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);
> -
> -/**
> - * cogl_swap_info_get_output:
> - * @info: a #CoglSwapInfo object
> - *
> - * Gets the #CoglOutput that the swapped frame was presented to.
> - *
> - * Return value: The #CoglOutput that the frame was presented to, or
> - *               %NULL if this could not be determined.
> - * Since: 2.0
> - * Stability: unstable
> - */
> -CoglOutput *
> -cogl_swap_info_get_output (CoglSwapInfo *info);
> -
> -G_END_DECLS
> -
> -#endif /* __COGL_SWAP_INFO_H */
> -
> -
> -
> diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
> index a6528f4..83dacf5 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));
>      }
>  }
> @@ -1594,7 +1594,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);
> @@ -1692,7 +1692,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;
>      }
>  }
> @@ -2368,7 +2368,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;
>  }
>  
> @@ -2411,14 +2411,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;
>      }
>  }
>  




More information about the Cogl mailing list