macos: reduce frequency of coordinates refresh
This change reduces to 3.33 times a second, the updates to the status bar coordinates widget. This dramatically improves frame rate on macOS retina displays because it reduces the frequency of full screen updates which are triggered by this widget updating and are very slow. This makes the statusbar refresh changes mac only where the benefit will be felt keenly, rather than saddling all platforms with the change.
This commit is contained in:
@ -1207,8 +1207,32 @@ gimp_statusbar_update_cursor (GimpStatusbar *statusbar,
|
||||
GimpImage *image;
|
||||
gchar buffer[CURSOR_LEN];
|
||||
|
||||
#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 curr_time = g_get_monotonic_time ();
|
||||
#endif
|
||||
|
||||
g_return_if_fail (GIMP_IS_STATUSBAR (statusbar));
|
||||
|
||||
#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 100ms */
|
||||
if (curr_time - statusbar->last_frame_time < 1000 * 300)
|
||||
return;
|
||||
|
||||
statusbar->last_frame_time = curr_time;
|
||||
#endif
|
||||
|
||||
shell = statusbar->shell;
|
||||
image = gimp_display_get_image (shell->display);
|
||||
|
||||
|
@ -44,6 +44,16 @@ 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
|
||||
|
||||
GdkPixbuf *icon;
|
||||
GHashTable *icon_hash;
|
||||
gint icon_space_width;
|
||||
|
Reference in New Issue
Block a user