[libchamplain] Use CLUTTER_PRIORITY_REDRAW for all idle functions



commit caa28356b43e1b75623c110eb16261a28c380a50
Author: JiÅÃ Techet <techet gmail com>
Date:   Wed Aug 17 22:39:52 2011 +0200

    Use CLUTTER_PRIORITY_REDRAW for all idle functions
    
    Clutter uses CLUTTER_PRIORITY_REDRAW for all its animations so we have to
    use at least this priority in order to avoid starvation in certain
    situations. There doesn't seem to be any need for other priorities
    at the moment.

 champlain/champlain-file-cache.c       |    2 +-
 champlain/champlain-label.c            |    2 +-
 champlain/champlain-marker.c           |    2 +-
 champlain/champlain-memphis-renderer.c |    2 +-
 champlain/champlain-path-layer.c       |    2 +-
 champlain/champlain-scale.c            |    2 +-
 champlain/champlain-view.c             |    5 ++---
 7 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/champlain/champlain-file-cache.c b/champlain/champlain-file-cache.c
index 90d757c..02e019d 100644
--- a/champlain/champlain-file-cache.c
+++ b/champlain/champlain-file-cache.c
@@ -922,7 +922,7 @@ void
 champlain_file_cache_purge_on_idle (ChamplainFileCache *file_cache)
 {
   g_return_if_fail (CHAMPLAIN_IS_FILE_CACHE (file_cache));
-  g_idle_add_full (G_PRIORITY_DEFAULT,
+  g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
       (GSourceFunc) purge_on_idle,
       g_object_ref (file_cache),
       (GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-label.c b/champlain/champlain-label.c
index 39c27bf..b291eb9 100644
--- a/champlain/champlain-label.c
+++ b/champlain/champlain-label.c
@@ -915,7 +915,7 @@ champlain_label_queue_redraw (ChamplainLabel *label)
   if (!priv->redraw_id)
     {
       priv->redraw_id =
-        g_idle_add_full (G_PRIORITY_DEFAULT,
+        g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
             (GSourceFunc) redraw_on_idle,
             g_object_ref (label),
             (GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-marker.c b/champlain/champlain-marker.c
index 37e89be..ec420e0 100644
--- a/champlain/champlain-marker.c
+++ b/champlain/champlain-marker.c
@@ -818,7 +818,7 @@ static void
 on_animation_completed (G_GNUC_UNUSED ClutterAnimation *animation,
     ChamplainMarker *marker)
 {
-  g_idle_add_full (G_PRIORITY_DEFAULT,
+  g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
       (GSourceFunc) on_idle,
       g_object_ref (marker),
       (GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-memphis-renderer.c b/champlain/champlain-memphis-renderer.c
index 1b7b61c..e1ef811 100644
--- a/champlain/champlain-memphis-renderer.c
+++ b/champlain/champlain-memphis-renderer.c
@@ -396,7 +396,7 @@ memphis_worker_thread (gpointer worker_data,
       cairo_destroy (cr);
     }
 
-  clutter_threads_add_idle_full (G_PRIORITY_DEFAULT, tile_loaded_cb, data, NULL);
+  clutter_threads_add_idle_full (CLUTTER_PRIORITY_REDRAW, tile_loaded_cb, data, NULL);
 }
 
 
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index 145ca46..a10402d 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -744,7 +744,7 @@ schedule_redraw (ChamplainPathLayer *layer)
   if (!layer->priv->redraw_scheduled)
     {
       layer->priv->redraw_scheduled = TRUE;
-      g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+      g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
           (GSourceFunc) redraw_path,
           g_object_ref (layer),
           (GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-scale.c b/champlain/champlain-scale.c
index aab30fb..34f5f06 100644
--- a/champlain/champlain-scale.c
+++ b/champlain/champlain-scale.c
@@ -461,7 +461,7 @@ schedule_redraw (ChamplainScale *scale)
   if (!scale->priv->redraw_scheduled)
     {
       scale->priv->redraw_scheduled = TRUE;
-      g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+      g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
           (GSourceFunc) redraw_scale,
           g_object_ref (scale),
           (GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 9c1b47e..435a276 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -615,7 +615,7 @@ champlain_view_allocate (ClutterActor *actor,
 
   if (priv->viewport_width != width || priv->viewport_height != height)
     {
-      g_idle_add_full (G_PRIORITY_HIGH_IDLE,
+      g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
           (GSourceFunc) _update_idle_cb,
           g_object_ref (view),
           (GDestroyNotify) g_object_unref);
@@ -1980,8 +1980,7 @@ view_load_visible_tiles (ChamplainView *view)
               g_object_ref (tile);
               g_object_ref (priv->map_source);
 
-              /* set priority high, otherwise tiles will be loaded after panning is done */
-              g_idle_add_full (G_PRIORITY_HIGH_IDLE, (GSourceFunc) fill_tile_cb, data, NULL);
+              g_idle_add_full (CLUTTER_PRIORITY_REDRAW, (GSourceFunc) fill_tile_cb, data, NULL);
             }
 
           x += dirs[turn % 4 + 1];



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