From 7ab54be3b7a12da09830d94b596cc759ce85393c Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 15 Feb 2013 16:51:11 +0000 Subject: [PATCH] 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 63c1a6dcf..1cf375fad 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 ad795b082..d7dd27161 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 8d86a9738..5bda9bf7e 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 e7df5893d..a96fa3e08 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