[gtk+] gdk_frame_clock_get_frame_time(): use gint64 for time
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk_frame_clock_get_frame_time(): use gint64 for time
- Date: Thu, 14 Feb 2013 22:26:48 +0000 (UTC)
commit 4c9749ee9e5e57c237ed2f1330ed826e4cc18da6
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Wed Feb 13 08:35:05 2013 -0500
gdk_frame_clock_get_frame_time(): use gint64 for time
gdk/gdkframeclock.c | 2 +-
gdk/gdkframeclock.h | 2 +-
gdk/gdkframeclockidle.c | 20 ++++++++++----------
gdk/gdkframeclockprivate.h | 2 +-
4 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/gdk/gdkframeclock.c b/gdk/gdkframeclock.c
index 00a1631..9c3d423 100644
--- a/gdk/gdkframeclock.c
+++ b/gdk/gdkframeclock.c
@@ -269,7 +269,7 @@ gdk_frame_clock_init (GdkFrameClock *clock)
* Return value: a timestamp in microseconds, in the timescale of
* of g_get_monotonic_time().
*/
-guint64
+gint64
gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock)
{
g_return_val_if_fail (GDK_IS_FRAME_CLOCK (frame_clock), 0);
diff --git a/gdk/gdkframeclock.h b/gdk/gdkframeclock.h
index 2459708..7b011ca 100644
--- a/gdk/gdkframeclock.h
+++ b/gdk/gdkframeclock.h
@@ -76,7 +76,7 @@ typedef enum {
GType gdk_frame_clock_get_type (void) G_GNUC_CONST;
-guint64 gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock);
+gint64 gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock);
GDK_AVAILABLE_IN_3_8
void gdk_frame_clock_request_phase (GdkFrameClock *frame_clock,
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c
index 5974e26..5e751b3 100644
--- a/gdk/gdkframeclockidle.c
+++ b/gdk/gdkframeclockidle.c
@@ -37,9 +37,9 @@ struct _GdkFrameClockIdlePrivate
{
GTimer *timer;
/* timer_base is used to avoid ever going backward */
- guint64 timer_base;
- guint64 frame_time;
- guint64 min_next_frame_time;
+ gint64 timer_base;
+ gint64 frame_time;
+ gint64 min_next_frame_time;
gint64 sleep_serial;
guint flush_idle_id;
@@ -135,12 +135,12 @@ gdk_frame_clock_idle_finalize (GObject *object)
G_OBJECT_CLASS (gdk_frame_clock_idle_parent_class)->finalize (object);
}
-static guint64
+static gint64
compute_frame_time (GdkFrameClockIdle *idle)
{
GdkFrameClockIdlePrivate *priv = idle->priv;
- guint64 computed_frame_time;
- guint64 elapsed;
+ gint64 computed_frame_time;
+ gint64 elapsed;
elapsed = g_get_monotonic_time () + priv->timer_base;
if (elapsed < priv->frame_time)
@@ -160,11 +160,11 @@ compute_frame_time (GdkFrameClockIdle *idle)
return computed_frame_time;
}
-static guint64
+static gint64
gdk_frame_clock_idle_get_frame_time (GdkFrameClock *clock)
{
GdkFrameClockIdlePrivate *priv = GDK_FRAME_CLOCK_IDLE (clock)->priv;
- guint64 computed_frame_time;
+ gint64 computed_frame_time;
/* can't change frame time during a paint */
if (priv->phase != GDK_FRAME_CLOCK_PHASE_NONE &&
@@ -196,8 +196,8 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
if (priv->min_next_frame_time != 0)
{
- guint64 now = compute_frame_time (clock_idle);
- guint64 min_interval_us = MAX (priv->min_next_frame_time, now) - now;
+ gint64 now = compute_frame_time (clock_idle);
+ gint64 min_interval_us = MAX (priv->min_next_frame_time, now) - now;
min_interval = (min_interval_us + 500) / 1000;
}
diff --git a/gdk/gdkframeclockprivate.h b/gdk/gdkframeclockprivate.h
index 262b327..0ce74da 100644
--- a/gdk/gdkframeclockprivate.h
+++ b/gdk/gdkframeclockprivate.h
@@ -47,7 +47,7 @@ struct _GdkFrameClockClass
{
GObjectClass parent_class;
- guint64 (* get_frame_time) (GdkFrameClock *clock);
+ gint64 (* get_frame_time) (GdkFrameClock *clock);
void (* request_phase) (GdkFrameClock *clock,
GdkFrameClockPhase phase);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]