summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-02-15 16:51:11 +0000
committerRobert Bragg <robert@linux.intel.com>2013-02-15 16:51:11 +0000
commit579eb75e6ac6f50d7a9cfe5093435126158b3c96 (patch)
tree409288ce72e3ba3d677f4b4befa2d68ffdd9a139 /examples
parent6655fee97fb6bcc2a516b710cc8ca1179685cb8f (diff)
downloadcogl-579eb75e6ac6f50d7a9cfe5093435126158b3c96.tar.gz
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.
Diffstat (limited to 'examples')
-rw-r--r--examples/cogl-gles2-context.c4
-rw-r--r--examples/cogl-gles2-gears.c4
-rw-r--r--examples/cogl-hello.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/cogl-gles2-context.c b/examples/cogl-gles2-context.c
index c102a0c3..68e75035 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 ad795b08..d7dd2716 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 8d86a973..5bda9bf7 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