mirror of https://github.com/GNOME/gimp.git
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:
parent
27b09104d9
commit
042eddfb0a
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue