summaryrefslogtreecommitdiff
path: root/gtk/gtktextlinedisplaycacheprivate.h
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2019-09-05 16:45:49 -0700
committerChristian Hergert <chergert@redhat.com>2019-09-05 19:06:35 -0700
commit5e49da1d73534e45e3139d7ded740f3115b7096f (patch)
treeb02be74afdbf81f4c7ddb398a929224b9e9673b8 /gtk/gtktextlinedisplaycacheprivate.h
parenta29853f53bba38a6657530aed8491630326b034e (diff)
downloadgtk+-5e49da1d73534e45e3139d7ded740f3115b7096f.tar.gz
textview: optimize linedisplay cache based on number of visible rows
This tries to estimate the number of visible rows in a textview based on the default text size and then tunes the GtkTextLineDisplayCache to keep 3*n_rows entries in the cache. This was found imperically to be near the right cache size. In most cases, this is less than the number of items we cache now. However, in some cases, such as the "overview map" from GtkSourceView, it allows us to reach a higher value such as 1000+. This is needed to keep scrolling smooth on the larger view sizes. With this patch, a HiDPI system with a GtkSourceView and GtkSourceMap from the GTK 4 port can perform smooth scrolling simultaneously.
Diffstat (limited to 'gtk/gtktextlinedisplaycacheprivate.h')
-rw-r--r--gtk/gtktextlinedisplaycacheprivate.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/gtktextlinedisplaycacheprivate.h b/gtk/gtktextlinedisplaycacheprivate.h
index 5639ec2070..89adbffc2d 100644
--- a/gtk/gtktextlinedisplaycacheprivate.h
+++ b/gtk/gtktextlinedisplaycacheprivate.h
@@ -53,6 +53,8 @@ void gtk_text_line_display_cache_invalidate_y_range (GtkText
gint y,
gint height,
gboolean cursors_only);
+void gtk_text_line_display_cache_set_mru_size (GtkTextLineDisplayCache *cache,
+ guint mru_size);
G_END_DECLS