summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-06-28 12:11:20 +0100
committerNeil Roberts <neil@linux.intel.com>2013-07-01 13:34:54 +0100
commit02f7fa538c9d2b383fa0f601177140b571ecf315 (patch)
tree1ecb93a72865fcf0f816c84f68170910cb03be50
parent8e5b4d40a4d960d0d20927d30ee68a37387fe776 (diff)
downloadcogl-02f7fa538c9d2b383fa0f601177140b571ecf315.tar.gz
poll: Always run the prepare callbacks for all sources
Eventually the Wayland winsys will want to do useful work in its prepare callback before the main loop goes idle. Previously cogl_poll_renderer_get_info would stop calling any further prepare functions if it found one with a zero timeout. That would mean the Wayland prepare function might not get called before going idle in some cases. This patch changes it so that it continues to call all of the prepare functions regardless of the timeout. Reviewed-by: Robert Bragg <robert@linux.intel.com>
-rw-r--r--cogl/cogl-poll.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/cogl/cogl-poll.c b/cogl/cogl-poll.c
index c50d6481..10d15606 100644
--- a/cogl/cogl-poll.c
+++ b/cogl/cogl-poll.c
@@ -58,10 +58,7 @@ cogl_poll_renderer_get_info (CoglRenderer *renderer,
*timeout = -1;
if (!_cogl_list_empty (&renderer->idle_closures))
- {
- *timeout = 0;
- return renderer->poll_fds_age;
- }
+ *timeout = 0;
for (l = renderer->poll_sources; l; l = l->next)
{
@@ -69,13 +66,8 @@ cogl_poll_renderer_get_info (CoglRenderer *renderer,
if (source->prepare)
{
int64_t source_timeout = source->prepare (source->user_data);
- if (source_timeout == 0)
- {
- *timeout = 0;
- return renderer->poll_fds_age;
- }
- else if (source_timeout > 0 &&
- (*timeout == -1 || *timeout > source_timeout))
+ if (source_timeout >= 0 &&
+ (*timeout == -1 || *timeout > source_timeout))
*timeout = source_timeout;
}
}