[cogl/cogl-1.14] avoid redundant idle if using FRAME_SYNC to throttle
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.14] avoid redundant idle if using FRAME_SYNC to throttle
- Date: Fri, 15 Feb 2013 17:50:39 +0000 (UTC)
commit 7ab54be3b7a12da09830d94b596cc759ce85393c
Author: Robert Bragg <robert linux intel com>
Date: Fri Feb 15 16:51:11 2013 +0000
avoid redundant idle if using FRAME_SYNC to throttle
This updates the examples and test-journal which now use the _FRAME_SYNC
events to throttle rendering so that they don't install a redundant idle
handler to paint when they get a FRAME_SYNC event and instead they now
directly paint when the event is received.
(cherry picked from commit 579eb75e6ac6f50d7a9cfe5093435126158b3c96)
examples/cogl-gles2-context.c | 4 ++--
examples/cogl-gles2-gears.c | 4 ++--
examples/cogl-hello.c | 2 +-
tests/micro-perf/test-journal.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/examples/cogl-gles2-context.c b/examples/cogl-gles2-context.c
index 63c1a6d..1cf375f 100644
--- a/examples/cogl-gles2-context.c
+++ b/examples/cogl-gles2-context.c
@@ -59,8 +59,8 @@ frame_event_cb (CoglOnscreen *onscreen,
CoglFrameInfo *info,
void *user_data)
{
- if (event == COGL_FRAME_EVENT_SYNC)
- g_idle_add (paint_cb, user_data);
+ if (event == COGL_FRAME_EVENT_SYNC)
+ paint_cb (user_data);
}
int
diff --git a/examples/cogl-gles2-gears.c b/examples/cogl-gles2-gears.c
index ad795b0..d7dd271 100644
--- a/examples/cogl-gles2-gears.c
+++ b/examples/cogl-gles2-gears.c
@@ -604,8 +604,8 @@ frame_event_cb (CoglOnscreen *onscreen,
CoglFrameInfo *info,
void *user_data)
{
- if (event == COGL_FRAME_EVENT_SYNC)
- g_idle_add (paint_cb, user_data);
+ if (event == COGL_FRAME_EVENT_SYNC)
+ paint_cb (user_data);
}
/**
diff --git a/examples/cogl-hello.c b/examples/cogl-hello.c
index 8d86a97..5bda9bf 100644
--- a/examples/cogl-hello.c
+++ b/examples/cogl-hello.c
@@ -29,7 +29,7 @@ frame_event_cb (CoglOnscreen *onscreen,
void *user_data)
{
if (event == COGL_FRAME_EVENT_SYNC)
- g_idle_add (paint_cb, user_data);
+ paint_cb (user_data);
}
int
diff --git a/tests/micro-perf/test-journal.c b/tests/micro-perf/test-journal.c
index e7df589..a96fa3e 100644
--- a/tests/micro-perf/test-journal.c
+++ b/tests/micro-perf/test-journal.c
@@ -130,7 +130,7 @@ frame_event_cb (CoglOnscreen *onscreen,
void *user_data)
{
if (event == COGL_FRAME_EVENT_SYNC)
- g_idle_add (paint_cb, user_data);
+ paint_cb (user_data);
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]