From 96e9f052a20864b8f860c9991d5cfa71ec567886 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 8 Oct 2003 14:50:26 +0000 Subject: [PATCH] Fixed bug #119423. There was no speed regression with the actual painting, 2003-10-08 Michael Natterer Fixed bug #119423. There was no speed regression with the actual painting, just with the display update (which effectively led to faster painting, it just felt slower). * app/display/gimpdisplayshell.c (gimp_display_shell_flush): added "gboolean now" parameter and update the display immediately if it is TRUE. * app/display/gimpdisplay.c (gimp_display_flush_whenever): pass the "now" we got passed to the function above, so calling gimp_display_flush_now() really flushes *now* again. --- ChangeLog | 14 ++++++++++++++ app/core/gimpprojection.c | 12 ++++++------ app/display/gimpdisplay.c | 12 ++++++------ app/display/gimpdisplayshell-draw.c | 6 +++++- app/display/gimpdisplayshell-draw.h | 3 ++- app/display/gimpdisplayshell.c | 6 +++++- app/display/gimpdisplayshell.h | 3 ++- 7 files changed, 40 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index b370491948..cdc2918dab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2003-10-08 Michael Natterer + + Fixed bug #119423. There was no speed regression with the actual + painting, just with the display update (which effectively led to + faster painting, it just felt slower). + + * app/display/gimpdisplayshell.c (gimp_display_shell_flush): added + "gboolean now" parameter and update the display immediately if + it is TRUE. + + * app/display/gimpdisplay.c (gimp_display_flush_whenever): pass + the "now" we got passed to the function above, so calling + gimp_display_flush_now() really flushes *now* again. + 2003-10-08 Michael Natterer * tools/pdbgen/pdb/fileops.pdb (file_load_invoker): diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 2b69a81e13..0fc31e7a38 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -68,7 +68,7 @@ static void gimp_display_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gimp_display_flush_whenever (GimpDisplay *gdisp, +static void gimp_display_flush_whenever (GimpDisplay *gdisp, gboolean now); static void gimp_display_idlerender_init (GimpDisplay *gdisp); static gboolean gimp_display_idlerender_callback (gpointer data); @@ -308,7 +308,7 @@ gimp_display_get_by_ID (Gimp *gimp, } void -gimp_display_reconnect (GimpDisplay *gdisp, +gimp_display_reconnect (GimpDisplay *gdisp, GimpImage *gimage) { g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); @@ -428,7 +428,7 @@ gimp_display_coords_in_active_drawable (GimpDisplay *gdisp, /* private functions */ static void -gimp_display_flush_whenever (GimpDisplay *gdisp, +gimp_display_flush_whenever (GimpDisplay *gdisp, gboolean now) { GimpDisplayShell *shell; @@ -488,7 +488,7 @@ gimp_display_flush_whenever (GimpDisplay *gdisp, } /* Next the displays... */ - gimp_display_shell_flush (shell); + gimp_display_shell_flush (shell, now); /* ensure the consistency of the menus */ if (! now) @@ -512,7 +512,7 @@ gimp_display_idlerender_init (GimpDisplay *gdisp) /* We need to merge the IdleRender's and the GimpDisplay's update_areas list * to keep track of which of the updates have been flushed and hence need - * to be drawn. + * to be drawn. */ for (list = gdisp->update_areas; list; list = g_slist_next (list)) { @@ -591,7 +591,7 @@ gimp_display_idlerender_callback (gpointer data) if (worky + workh > gdisp->idle_render.basey + gdisp->idle_render.height) { workh = gdisp->idle_render.basey + gdisp->idle_render.height - worky; - } + } gimp_display_paint_area (gdisp, workx, worky, workw, workh); diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 2b69a81e13..0fc31e7a38 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -68,7 +68,7 @@ static void gimp_display_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gimp_display_flush_whenever (GimpDisplay *gdisp, +static void gimp_display_flush_whenever (GimpDisplay *gdisp, gboolean now); static void gimp_display_idlerender_init (GimpDisplay *gdisp); static gboolean gimp_display_idlerender_callback (gpointer data); @@ -308,7 +308,7 @@ gimp_display_get_by_ID (Gimp *gimp, } void -gimp_display_reconnect (GimpDisplay *gdisp, +gimp_display_reconnect (GimpDisplay *gdisp, GimpImage *gimage) { g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); @@ -428,7 +428,7 @@ gimp_display_coords_in_active_drawable (GimpDisplay *gdisp, /* private functions */ static void -gimp_display_flush_whenever (GimpDisplay *gdisp, +gimp_display_flush_whenever (GimpDisplay *gdisp, gboolean now) { GimpDisplayShell *shell; @@ -488,7 +488,7 @@ gimp_display_flush_whenever (GimpDisplay *gdisp, } /* Next the displays... */ - gimp_display_shell_flush (shell); + gimp_display_shell_flush (shell, now); /* ensure the consistency of the menus */ if (! now) @@ -512,7 +512,7 @@ gimp_display_idlerender_init (GimpDisplay *gdisp) /* We need to merge the IdleRender's and the GimpDisplay's update_areas list * to keep track of which of the updates have been flushed and hence need - * to be drawn. + * to be drawn. */ for (list = gdisp->update_areas; list; list = g_slist_next (list)) { @@ -591,7 +591,7 @@ gimp_display_idlerender_callback (gpointer data) if (worky + workh > gdisp->idle_render.basey + gdisp->idle_render.height) { workh = gdisp->idle_render.basey + gdisp->idle_render.height - worky; - } + } gimp_display_paint_area (gdisp, workx, worky, workw, workh); diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 4536944c50..003d1175bc 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -1174,11 +1174,15 @@ gimp_display_shell_expose_full (GimpDisplayShell *shell) } void -gimp_display_shell_flush (GimpDisplayShell *shell) +gimp_display_shell_flush (GimpDisplayShell *shell, + gboolean now) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); gimp_display_shell_update_title (shell); + + if (now) + gdk_window_process_updates (shell->canvas->window, FALSE); } void diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h index d34d034928..a0e921b216 100644 --- a/app/display/gimpdisplayshell-draw.h +++ b/app/display/gimpdisplayshell-draw.h @@ -226,7 +226,8 @@ void gimp_display_shell_expose_guide (GimpDisplayShell *shell, GimpGuide *guide); void gimp_display_shell_expose_full (GimpDisplayShell *shell); -void gimp_display_shell_flush (GimpDisplayShell *shell); +void gimp_display_shell_flush (GimpDisplayShell *shell, + gboolean now); void gimp_display_shell_pause (GimpDisplayShell *shell); void gimp_display_shell_resume (GimpDisplayShell *shell); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 4536944c50..003d1175bc 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1174,11 +1174,15 @@ gimp_display_shell_expose_full (GimpDisplayShell *shell) } void -gimp_display_shell_flush (GimpDisplayShell *shell) +gimp_display_shell_flush (GimpDisplayShell *shell, + gboolean now) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); gimp_display_shell_update_title (shell); + + if (now) + gdk_window_process_updates (shell->canvas->window, FALSE); } void diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index d34d034928..a0e921b216 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -226,7 +226,8 @@ void gimp_display_shell_expose_guide (GimpDisplayShell *shell, GimpGuide *guide); void gimp_display_shell_expose_full (GimpDisplayShell *shell); -void gimp_display_shell_flush (GimpDisplayShell *shell); +void gimp_display_shell_flush (GimpDisplayShell *shell, + gboolean now); void gimp_display_shell_pause (GimpDisplayShell *shell); void gimp_display_shell_resume (GimpDisplayShell *shell);