canvas: remove limits on ruler & statusbar updates

This removes rate limiting of ruler and statusbar updates which were
required to get acceptable performance on mac for drawing on the canvas.

This requires the latest changes on in Gtk 3.24 to be incorporated.
This commit is contained in:
Lukas Oberhuber 2022-06-26 13:21:16 +01:00 committed by Jehan
parent 27b09104d9
commit 042eddfb0a
3 changed files with 0 additions and 65 deletions

View File

@ -1815,27 +1815,6 @@ gimp_statusbar_queue_pos_redraw (gpointer data)
shell = statusbar->shell;
image = gimp_display_get_image (shell->display);
#ifdef GDK_WINDOWING_QUARTZ
/*
* This optimization dramatically improves drawing refresh speed on Macs with retina
* displays, which is all macbook pros since 2016 and macbook airs since 2018 and
* running Big Sur (released Nov 2020) or higher.
* https://gitlab.gnome.org/GNOME/gimp/-/issues/7690
*
* only redraw max every 333ms and only redraw when the other two decorations aren't
* redrawing (cursor_label, horizontal and vertical rulers). This will keep the draw
* rects of limited size.
*/
gint64 curr_time = g_get_monotonic_time ();
gint64 mod_time = curr_time % G_TIME_SPAN_SECOND;
gint timeslice_num = mod_time / (G_TIME_SPAN_SECOND / 9) % 3;
if (curr_time - statusbar->last_frame_time < G_TIME_SPAN_SECOND / 3 || timeslice_num != 0)
return G_SOURCE_CONTINUE;
statusbar->last_frame_time = curr_time;
#endif
if (image)
{
image_width = gimp_image_get_width (image);

View File

@ -44,15 +44,6 @@ struct _GimpStatusbar
GHashTable *context_ids;
guint seq_context_id;
#ifdef GDK_WINDOWING_QUARTZ
/*
* This optimization dramatically improves drawing refresh speed on Macs with retina
* displays, which is all macbook pros since 2016 and macbook airs since 2018 and
* running Big Sur (released Nov 2020) or higher.
* https://gitlab.gnome.org/GNOME/gimp/-/issues/7690
*/
gint64 last_frame_time;
#endif
guint statusbar_pos_redraw_idle_id;
gchar *cursor_string_todraw;
gchar *cursor_string_last;

View File

@ -77,16 +77,6 @@ struct _GimpRulerPrivate
PangoLayout *layout;
GList *track_widgets;
#ifdef GDK_WINDOWING_QUARTZ
/*
* This optimization dramatically improves drawing refresh speed on Macs with retina
* displays, which is all macbook pros since 2016 and macbook airs since 2018 and
* running Big Sur (released Nov 2020) or higher.
* https://gitlab.gnome.org/GNOME/gimp/-/issues/7690
*/
gint64 last_frame_time;
#endif
};
#define GET_PRIVATE(obj) (((GimpRuler *) (obj))->priv)
@ -1274,31 +1264,6 @@ gimp_ruler_idle_queue_pos_redraw (gpointer data)
GimpRuler *ruler = data;
GimpRulerPrivate *priv = GET_PRIVATE (ruler);
#ifdef GDK_WINDOWING_QUARTZ
/*
* This optimization dramatically improves drawing refresh speed on Macs with retina
* displays, which is all macbook pros since 2016 and macbook airs since 2018 and
* running Big Sur (released Nov 2020) or higher.
* https://gitlab.gnome.org/GNOME/gimp/-/issues/7690
*
* only redraw max every 333ms and only redraw when the other two decorations aren't
* redrawing (cursor_label, horizontal and vertical rulers). This will keep the draw
* rects of limited size.
*/
gint64 curr_time = g_get_monotonic_time ();
gint64 mod_time = curr_time % G_TIME_SPAN_SECOND;
gint timeslice_num = mod_time / (G_TIME_SPAN_SECOND / 9) % 3;
if (curr_time - priv->last_frame_time < G_TIME_SPAN_SECOND / 3)
return G_SOURCE_CONTINUE;
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && timeslice_num != 1)
return G_SOURCE_CONTINUE;
if (priv->orientation == GTK_ORIENTATION_VERTICAL && timeslice_num != 2)
return G_SOURCE_CONTINUE;
priv->last_frame_time = curr_time;
#endif
gimp_ruler_queue_pos_redraw (ruler);
/*