Author: post
Date: 2012-01-05 22:22:45 +0100 (Thu, 05 Jan 2012)
New Revision: 4091

Modified:
   trunk/src/rs-preview-widget.c
Log:
Use 200% of median time as default update wait interval.

Modified: trunk/src/rs-preview-widget.c
===================================================================
--- trunk/src/rs-preview-widget.c       2012-01-05 21:21:02 UTC (rev 4090)
+++ trunk/src/rs-preview-widget.c       2012-01-05 21:22:45 UTC (rev 4091)
@@ -2948,8 +2948,17 @@
                /* If we receive a finish_rendering, also stop waiting for 
further events */
                do {
                        g_get_current_time(&render_timeout);
-                       /* Add 50ms to current time */
-                       g_time_val_add(&render_timeout, 50 * 1000); 
+                       /* Get 200% percent of median update time and add that 
to current time */
+                       gint wait = rs_get_median_update_time() * 2000;
+
+                       /* If we haven't collected enough samples, wait 50ms */
+                       if (wait <= 0)
+                               wait = 50 * 1000;
+                       /* Wait at least 30ms */
+                       if (wait <= 30 * 1000)
+                               wait = 50 * 1000;
+
+                       g_time_val_add(&render_timeout, wait); 
                        gdk_rectangle_union(&dirty_area_accum, &t->dirty_area, 
&dirty_area_accum);
                } while (!t->finish_rendering && TRUE == 
g_cond_timed_wait(t->render, t->render_mutex, &render_timeout) && 
!t->finish_rendering);
 


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to