[cogl] poll: Always run the prepare callbacks for all sources



commit 02f7fa538c9d2b383fa0f601177140b571ecf315
Author: Neil Roberts <neil linux intel com>
Date:   Fri Jun 28 12:11:20 2013 +0100

    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>

 cogl/cogl-poll.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/cogl/cogl-poll.c b/cogl/cogl-poll.c
index c50d648..10d1560 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;
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]