[cogl] avoid redundant idle if using FRAME_SYNC to throttle



commit 579eb75e6ac6f50d7a9cfe5093435126158b3c96
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.

 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 c102a0c..68e7503 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 dec485b..84d3c06 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]