[gimp/gimp-2-10] app: increase display update rate



commit 50ef78a52ee1b17722d1ae0a9fb80c6afe3111bf
Author: Ell <ell_se yahoo com>
Date:   Tue Feb 4 17:32:32 2020 +0200

    app: increase display update rate
    
    Now that painting is done in a separate thread, the display update
    rate has a far smaller impact on it.  Increate the GimpDisplay
    update rate, which handles image updates, to 60 FPS, and the
    GimpDrawTool update rate to 120 FPS.  In particular, the latter
    change makes brush-outline motion much smoother.

 app/display/gimpdisplay.c | 4 ++--
 app/tools/gimpdrawtool.c  | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c
index f7cb07234f..e3dc7b4bf7 100644
--- a/app/display/gimpdisplay.c
+++ b/app/display/gimpdisplay.c
@@ -52,7 +52,7 @@
 #include "gimp-intl.h"
 
 
-#define FLUSH_NOW_INTERVAL      20000 /* 20 ms in microseconds */
+#define FLUSH_NOW_INTERVAL      (G_TIME_SPAN_SECOND / 60)
 
 #define PAINT_AREA_CHUNK_WIDTH  32
 #define PAINT_AREA_CHUNK_HEIGHT 32
@@ -912,7 +912,7 @@ gimp_display_flush_whenever (GimpDisplay *display,
 
       if ((now - private->last_flush_now) > FLUSH_NOW_INTERVAL)
         {
-          gimp_display_shell_flush (gimp_display_get_shell (display), now);
+          gimp_display_shell_flush (gimp_display_get_shell (display), TRUE);
 
           private->last_flush_now = now;
         }
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index ec8c9e8326..b97e30a052 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -53,9 +53,10 @@
 #include "gimptoolcontrol.h"
 
 
-#define DRAW_TIMEOUT              4
-#define USE_TIMEOUT               1
-#define MINIMUM_DRAW_INTERVAL 50000 /* 50000 microseconds == 20 fps */
+#define USE_TIMEOUT
+#define DRAW_FPS              120
+#define DRAW_TIMEOUT          (1000 /* milliseconds */ / (2 * DRAW_FPS))
+#define MINIMUM_DRAW_INTERVAL (G_TIME_SPAN_SECOND / DRAW_FPS)
 
 
 static void          gimp_draw_tool_dispose       (GObject          *object);


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